Clipping Canvas

BlitzMax Forums/BlitzMax Programming/Clipping Canvas

I'm having a problem with my Canvases. When it resizes to a larger size than the original canvas that was created, it clips the OpenGL to the size of the originally created canvas. What am I doing wrong?

Resize code:
	If Vrs.E = EVENT_WINDOWSIZE and EventSource() = Wn Then
		gfx_width = ClientWidth(Can)
		gfx_height = ClientHeight(Can)
		SetGraphics CanvasGraphics(Can)
		SetViewport 0,0,gfx_width,gfx_height
		glMatrixMode GL_PROJECTION
		glLoadIdentity
		gluPerspective 20,Float(gfx_WIDTH)/Float(GFX_HEIGHT),0.01,50
		glGetDoublev GL_PROJECTION_MATRIX,Stat.pjMatrix
		SetViewport 0,0,gfx_width,gfx_height
	End If


Note that the perspective view sizes correctly, but is clipped as if the viewport is getting clipped. [edit] Changed it to SetViewport.