# Lwjgl or opengl double pixels

I'm working in java with LWJGL and trying to double all my pixels. I'm trying to draw in an area of 800x450 and then stretch all the frame image to the complete 1600x900 pixels without them getting blured. I can't figure out how to do that in java, everything I find is in c++... A hint would be great!

Thanks a lot.

EDIT : I've tried drawing to a texture created in opengl by setting it to the framebuffer, but I can't find a way to use glGenTextures() in java... so this is not working... also I though about using a shader but I would not be able to draw only in the smaller region...

• oh sorry yeah, I've tried drawing to a texture created in opengl by setting it to the framebuffer, but I can't find a way to use glGenTextures() in java... so this is not working... also I though about using a shader but I would not be able to draw only in the smaller region... – Philippe Paré Nov 10 '13 at 2:05
• unfortunatly I didn't get any of them to work... sorry – Philippe Paré Nov 12 '13 at 20:51

Try setting the texture filtering (GL_TEXTURE_MIN_FILTER and GL_TEXTURE_MAG_FILTER) to GL_NEAREST
GL_NEAREST_MIPMAP_LINEAR is the default on most platforms, which would explain the blurring you are getting.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
• I just did a little googling and you are right, the default is GL_NEAREST_MIPMAP_LINEAR. I thought this was weird though, because to actually get mipmaps you have to call glGenerateMipmap() I'll change my answer accordingly. – RamblingMad Nov 11 '13 at 6:03