Hi,
I wanted to create a 2D game, first of all i had made it only with Canvas but the Pogramm had a bad performance.
I had read that OpenGL is even ideal for 2DGraphics, so I made a few tutorials but my Problem is, that the tutorials are not up-to-date, for exapmle there is a class named factory used for creating the GLCanvas.
And the Tutorial wich explain how to make a 2Dgame with OpenGL is written for Delphi.
I had written all the Programm in Java(wich connects with a server…because it should be a OnlineRGPGame) so i want to write still in java.
Maybe there is a easier way for Programming a 2d Game with a nice performance, and i will be thankful if somebody could tell me, but i also would know how actually textures are going to create in JOGL.
I had allready my Images created in a BufferedImage, so i would to prefer not to use a ImageFileLoader.
I only want to know how to draw a Texture(BufferedImage) on a simple Polygon.
I made my Homework so i know that there is a class named TextureData with the constructor:
TextureData(int internalFormat, int pixelFormat, boolean mipmap, BufferedImage image)
And i knows that Textures had to be activated first with: gl.glEnable(GL.GL_TEXTURE_2D);
and i know that there is a function: gl.glTexImage2D(GL.GL_TEXTURE_2D,0,GL.GL_RGBA,8,8,0,GL.GL_RGBA,GL.GL_INT,texDat.getBuffer());
but i dont know actually what i had to do that Jogl draws the texture wich is in my BufferedImage on a Polygone.
Thanks for Answers.
P.S.
If u dont want to write me a answer but u know either a easier way or an up-to-date, well done tutorial i would be glad.
Thanks