We consider variance-optimal hedging in general continuous-time affine stochastic volatility models. The optimal hedge and the associated hedging error are determined semiexplicitly in the case that the stock price follows a martingale. The integral representation of the solution opens the door to efficient numerical computation. The setup includes models with jumps in the stock price and in the activity process. It also allows for correlation between volatility and stock price movements. Concrete parametric models will be illustrated in a forthcoming paper.