Zoom image but avoid blur

Started by
0 comments, last by Wooh 15 years, 4 months ago
Hi! I try to make a simple 2D game with SDL and OpenGL. The game is 320x200 pixels and that's too small to show as it is on the screen. I want to be able to scale the the pixels so the game window gets bigger and one pixel will result in 4, 9, 16, .. pixels depending on the size of the screen. I know I can change the screen resolution and show the game in fullscreen and it will be great but that is probably not always very good for such small size. I don't know the best way of doing this. I have thought it might be possible to simply change some settings to zoom the whole area instead of change values whenever I draw an image. When I tried to draw the images bigger than they are the pixels got blurry. I want no blurry effect what so ever. In the image to the left is like I want it to be, to the right is how OpenGL blur my poor pixels :(
Advertisement
Maybe my first post was a little confusing. Anyway, I found a solution:
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);


The zoom thing I talked about in previous post, I found out that it was very dynamic when I changed the size of the window so I don't think that will be any problems. ;)

This topic is closed to new replies.

Advertisement