tags:

views:

45

answers:

1

I have a 480x320 NSOpenGLView that I'd like to scale up to 960x640, but in a way that pixels appear as twice the size (and sharp).

If I call

[myglview setFrame:CGRectMake(0,0,960,640)];

the view scales up to the desired size, but the pixels rendered by OpenGL calls are still at the native resolution.

How can I scale up the GL view, pixels' size included?

+1  A: 

You render into a 480x320 FBO, and use this FBO as a texture on a screen-aligned quad with NEAREST filtering in a second pass.

eile
Thanks! Can you give a few pointers as to which commands to use? I'll definitely have to learn about FBOs, and about using them as a texture, but any extra help will be greatly appreciated.
Steph Thirion
Ok this solution worked for me. I had to use a power of two sized texture though, to be compatible with older ATI cards. So in my case, to have a 480x320 screen doubled, I used a 512x512 texture.
Steph Thirion