OpenGL viewport render gave squeezed results in cases.
Reason: some graphics cards only give offscreen buffers in multiples
of 256 or 512 (my case). 

Current fix uses the actual size returned by graphics card, which
is also safe for too large renders.
More elaborate cropping or matching is for another time.

(Added printf for feedback on this, might disappear)
This commit is contained in:
2010-11-18 19:11:05 +00:00
parent e76074da0b
commit aef3e99eab
4 changed files with 15 additions and 7 deletions

View File

@@ -144,9 +144,10 @@ void GPU_framebuffer_free(GPUFrameBuffer *fb);
void GPU_framebuffer_restore();
/* GPU OffScreen
- wrapper around framebuffer and texture for simple offscreen drawing */
- wrapper around framebuffer and texture for simple offscreen drawing
- changes size if graphics card can't support it */
GPUOffScreen *GPU_offscreen_create(int width, int height);
GPUOffScreen *GPU_offscreen_create(int *width, int *height);
void GPU_offscreen_free(GPUOffScreen *ofs);
void GPU_offscreen_bind(GPUOffScreen *ofs);
void GPU_offscreen_unbind(GPUOffScreen *ofs);