Help Forum or Fudge Forum?

Every answer I have had is a fudge.

Is this a help forum or a fudge forum!
If it is a help forumn->

could some one please show me how to draw a subimage with transparent areas on top of another image!

Every time I try using this ****ing code.
The transparent areas turn black instead of showing the image beneath.

glClearColor(0.0f, 0.0f, 0.0f, 1.0f) ;
glShadeModel(GL_FLAT);
file://glEnable(GL_DEPTH_TEST);

int x,y;
for(x =0; x < 128; x++)
{
for(y = 0; y < 128; y++)
{
Tile[x][y][0] = 255;
Tile[x][y][1] = 0;
Tile[x][y][2] = 0;
Tile[x][y][3] = 255;

}
}

pngLoadRaw(“E:\Grass.png”,&info[0]);
pngLoadRaw(“E:\Marsh.png”,&info[1]);

glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 128, 128,
0, GL_RGBA, GL_UNSIGNED_BYTE,Tile) ;

glTexSubImage2D(GL_TEXTURE_2D,0,0,0,64,64,GL_RGB,GL_UNSIGNED_BYTE,info[0].Data);
glTexSubImage2D(GL_TEXTURE_2D,0,0,64,64,64,GL_RGB,GL_UNSIGNED_BYTE,info[0].Data);
glTexSubImage2D(GL_TEXTURE_2D,0,64,0,64,64,GL_RGB,GL_UNSIGNED_BYTE,info[0].Data);
glTexSubImage2D(GL_TEXTURE_2D,0,64,64,64,64,GL_RGB,GL_UNSIGNED_BYTE,info[0].Data);

void COpenGLView: rawGL()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glEnable(GL_TEXTURE_2D);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5);
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,64,64,GL_RGBA,GL_UNSIGNED_BYTE,info[1].Data);
glBegin(GL_QUADS);
glTexCoord2f(0,0); glVertex2i(10,138);
glTexCoord2f(0,1); glVertex2i(10,10);
glTexCoord2f(1,1); glVertex2i(138,10);
glTexCoord2f(1,0); glVertex2i(138,138);
glEnd();

glDisable(GL_BLEND);
glDisable(GL_ALPHA_TESTglFlush();

glDisable(GL_TEXTURE_2D);
}

Opengl easier then D3D!
My arsehole!

Fudge forum? maybe you should take us back and get a refund? Really, we’re not a service that comes packaged with your opengl libraries that is meant to act as technical support for you, the loyal customer so we can think and you don’t have to.

A couple of points about your code:

  1. where do you enable blending? Unless i’ve missed it, you disable it, but never enable it.
  2. where is your BLEND function?
  3. why are you setting the clear alpha to 1.0? if you think about how the alpha values work, you’re saying that “100% of the destination colour contributes to the final colour of the pixel”, and the destination colour is black…

to fix:

  • set your clear colour to 0% ALPHA (sit down with a pencil and paper and work out the maths and see how it works)
  • enable blending
  • make sure your blend func is “what you expect”. what do you expect? i have no idea ;>

cheers
John

hey, nobody says that changes are simple!
if you used to code D3D, you learnt a philosophy: if you move to OpenGL, the philosophy changes.

each API has different idiosyncrasies you have to deal with: the only way through is to open your mind and explore!

…yeah…

Dolo//\ightY

I think dmy may be smokin some serious sh*t?

no, he isn’t. it’s a different paradigm, which isn’t to say one is better than the other, but they ARE different and you MUST appreciate that.

I mean, in the same way imperative programming languages require a different perspective on problems than functional programming languages, and same again with logical programming languages, and ditto with object orientated langauges. if you think imperative (ie. control based with side effects) then you CANNOT program in a functional language (no side effects, and control is implicit). which is better? who knows? who cares? it’s just DIFFERENT. (OK, that was a bit too flippant… people do know, and they DO care

cheers
John

To ironduke : your ‘penis’ message has already been deleted from this forum. It seems that you go on with your stupid behaviour anyway… Didn’t the operators of the board ask you to moderate your words ???

Regards (to the others !).

Eric

Eric.

I did not start that thread, I simply answered it, with a non-offensive joke and the scum boy insulted my mother.

So I gave him both barrels!

Get it right jerky.

Ironduke, i hope you understand that your attitude makes people not wanna answer your questions.

Your Kidding!

I got more replies to this bastard then any other post in this forum

Wehayyyyyyyyyyyyyy!!!1111