Sign in to follow this  
bdude

SDL + opengl blurry pixel and fullscreen issue

Recommended Posts

bdude    100
Hi gamedev :) I am currently writing my game in SDL and opengl. It is 2D and I load all my sprites into textures. My sample games in my engine runs at 400x300, 640x400 etc. Pixel-perfection to me is important, since I make the art as pixel art. At startup I go to fullscreen mode. Before I had GForce 5500, and the game was fullscreen and pixel-perfect (no blurry niss). Since I've bought a new pc with GTX260 graphics card. I also have two screens now, one is 17inch (my old screen) and new one is 23 inch. When the 17inch is primary (the 23 inch disabled) the graphics are still perfectly fullscreen, however it is blurry and not pixel perfect anymore. When the 23inch is active, but 17inch still primary, the graphics is again blurry. Also, the game only displays in the bottom left part of the screen and doesn't show fullscreen, the rest (top-right) of the screen is black. Why does this happen? I assume I need to implementing some filtering? Like nearest-neighbour filtering? I'm not sure how though. Currently I draw my textures to screen applied to quads, right before I draw I have this code:
// draw image
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
// Bind the texture to which subsequent calls refer to
glBindTexture(GL_TEXTURE_2D, texture);
glBegin( GL_QUADS );
  // ... draw the vertices with their clipping here
glEnd();
glDisable(GL_ALPHA_TEST);  
(Note: I load my sprites in already as transparent pngs.) I've tried putting linear filtering:
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
in, but it doesn't change anything. I hope someone can explain to me what to do, I've tried google-ing, and will continue, but I'm not sure what keywords yet. Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this