Hello, I’m a very very n00b in OpenGL, I can’t get all opengl drawing function in nehe and the red book to work! 
Even the basic one to draw triangle and square 
The sample is working perfectly, but when I use it in my code, it show nothing or even worse my previous rendering is gone!
Is this related with my opengl initialization? Cos the different from the sample is only in initialization.
I use kevglass spaceinvaders tutorial to init GL and render texture, this is for 2D games anyway, and so far I can render opaque and full transparent (bitmask) image in screen, it’s great! 
Now I’m trying to draw rectangle, circle, fill rectangle, circle, and drawing scaling image with alpha blending.
Anyone can help me with some code? I’m not going to deep with opengl, it’s frustrating me, I only need to have a working replacement to my Java2D rendering functions.
This is my GL init :
// init GL
// enable textures since we're going to use these for our sprites
GL11.glEnable(GL11.GL_TEXTURE_2D);
// disable the OpenGL depth test since we're rendering 2D graphics
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, size.width, size.height, 0, -1, 1);
// enable transparency
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
All textures and how to load it is plain same with kevglass tutorial.
I need code with this one :
Color col;
public void fillRect(int x, int y, int width, int height) {
// draw and fill rectangle with specified coordinate and color col
}
public void drawRect(int x, int y, int width, int height) {
// draw rectangle
}
public boolean drawImage(Texture tex, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2) {
// drawing texture tex to dx1, dy1 with size dx2-dx1, dy2-dy1
// and draw partial of image from sx1, sy1 with size sx2-sx1, sy2-sy1
}
// this is what i do to draw image
// i even don't know what is going on there :) directly taken from the tutorial
public boolean drawImage(Texture tex, int x, int y) {
// store the current model matrix
GL11.glPushMatrix();
texture.bind();
// translate to the right location and prepare to draw
GL11.glTranslatef(x, y, 0);
// draw a quad textured to match the sprite
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glTexCoord2f(0, 0);
GL11.glVertex2f(0, 0);
GL11.glTexCoord2f(0, texture.getHeight());
GL11.glVertex2f(0, texture.getImageHeight());
GL11.glTexCoord2f(texture.getWidth(), texture.getHeight());
GL11.glVertex2f(texture.getImageWidth(), texture.getImageHeight());
GL11.glTexCoord2f(texture.getWidth(), 0);
GL11.glVertex2f(texture.getImageWidth(), 0);
}
GL11.glEnd();
// restore the model view matrix to prevent contamination
GL11.glPopMatrix();
return true;
}
Hopefully someone kind here can help…
Have been fiddle with this GL stuff overnight and got not advance than rendering image… 
Guess this basic operation should be easy to do.
Thanks in advance…
PS: if anyone curious what I’m trying to do, i’m trying to replace my Java2D rendering with OpenGL
so I’m not taking this opengl stuff too much, cos so far I see it’s about making 3D stuff
if anyone know any LWJGL resources related with 2D, please let me know
