gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > 3D Color problems

#40612 - Locke - Wed Apr 20, 2005 11:18 pm

I found some problems about the color functions when dealing with 3D.

glClearColor seems to work fine on iDeaS (although it will only reset when I close and reopen the emu, even if I change the code) but in real hw the screen is always black. This is pretty dissapointing, as I was trying to see the cel-shading effect...

glColor is also buggy, I can get it to work correctly... maybe I'm doing something wrong...

Any ideas on how to get this funtions to work?

#40633 - Ethos - Thu Apr 21, 2005 1:32 am

I used this

Code:
void glColor3f(GLfloat x,
                GLfloat y,
                GLfloat z) {
    uint8 red = (uint8)((x * 31));
    uint8 green = (uint8)((y * 31));
    uint8 blue = (uint8)((z * 31));
                   
    glColor3b(red, green, blue);
}


It is defined the exact same way as the openGL function (1.0 max, 0 min)

#40634 - ecurtz - Thu Apr 21, 2005 1:38 am

I had to reset glClearColor each time inside my drawing loop to get it to stick. (Although it is possible I was just setting it too early and it only needs to happen once.)