COPYRECT in blitzmax ??

BlitzMax Forums/BlitzMax Programming/COPYRECT in blitzmax ??

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yes you'd need to restore the fullscreen viewport after you've specified a smaller one. Please note though that according to the OpenGL documentation, defining a viewport smaller than the screen doesn't necessarily mean that nothing will be drawn outside of the viewport area. You should be defining a SCISSOR area and enabling the scissor test. This will ensure that there is no drawing outside the viewport.

Another way to do this, if you want to do more of your own OpenGL, is you set up a dummy image like what CreateImage does, do a grab image, and then instead of doing the viewport/drawimage part, switch on texturing yourself and draw a quad at whatever coords and specify the texture coordinates for each vertex. This will allow you to render only a part of the total image, and it doesn't have to be square.