-1

I'm fairly new to JOGL and i was trying to make all of my textures have antialiasing disabled. though for some reason it only works on a texture of the Letter 'S'.

here are all of my classes:

Main: pastebin.com/qxCJKbbE

Room: pastebin.com/mKFSgqBp

MainMenu: pastebin.com/tihb3wAX

RenderHelper: pastebin.com/qfzXqCQY

i.imgur.com/qMRyG0j.png

Also, apparently I'm not allowed to post more than 2 links or pictures without more reputation so i just took away the http:\\ and linked the image.

Marcus13345
  • 63
  • 1
  • 2
  • 8
  • 1
    Don't expect people to wade through your entire codebase and figure out what's going on; isolate the problem and post selected pieces of code. – Torious Feb 18 '13 at 07:29
  • i have tried literally everything i can find. nothing seems to work. the problem is obviously something in the texture because it is only applying to that texture. though nothing different is done to that texture throughout the code. i am simply asking if there's some special way to do it that i'm missing. and just so you know, my code isn't really that large. i simply have a while true game loop that calls a render that redirects to the current room and renders. from the room you can see a bit of the renderhelper class drawing cubes. i would understand if my code were more complex. – Marcus13345 Feb 18 '13 at 07:46

1 Answers1

0

glTexParameterf only affects the texture that is currently bound. You should set non-changing texture parameters for each texture during loadind/setup.

For this purpose, you can also use convenient methods of the Texture class, for example:

C = render.getTexture("E:\\MAndWorks\\resources\\font\\C.png");
C.setTexParameterf(GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);
// (note that this also binds the texture behind the scenes)

The reason it worked for the letter "S" is that it is the last texture you render in your render pass, so it is still bound when you set the texture parameter in the next call to display, effectively setting the parameter for the "S" texture.

Good luck.

Torious
  • 3,364
  • 17
  • 24
  • Thank you so much! this must be the trick i was missing! i was under the impression that that bit of code was only needed in the init(GLAutoDrawable) call. I will go try it right now! – Marcus13345 Feb 18 '13 at 23:11
  • so, I see what you are saying by having the non changing parameters, though if i try to simply add `C.setTexParameterf(GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);` after setting `C`, it gives me an error because such a method does not exist. edit: turns out the method needs another parameter, a GL2 object. to achieve this i added a GL2 parameter to the MainMenu constructor that passed into the `setTexParameterf(GL2, int, float);` – Marcus13345 Feb 18 '13 at 23:19