LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Unknown on October 27, 2005, 08:51:36

Title: Fading effects?
Post by: Unknown on October 27, 2005, 08:51:36
Simply put: what would be the easiest way to make simple fading effects with LWJGL/OpenGL? Between menu "screens"? With black/white color? I suppose I could use Display.setDisplayConfiguration and just change screen brightness (or gamma), but whenever I try to call it, LWJGLException is thrown. It seems to work in other games using LWJGL, though.
Any help would be welcome!  :P
Title: Fading effects?
Post by: oNyx on October 27, 2005, 11:25:57
Draw stuff... disable texturing... set the color to something with alpha... draw a quad ontop.
Title: Fading effects?
Post by: Unknown on October 28, 2005, 06:43:17
Thanks! But how can I set color alpha? I've been browsing through the Holy Red Book Of OpenGL every now and then, but I haven't spotted anything about this... Is done like this: glColor4f? (Just checked LWJGL javadocs) :D
Title: Fading effects?
Post by: elias on October 28, 2005, 07:26:48
Yep, glColor4f is your friend.

- elias
Title: Fading effects?
Post by: Unknown on November 01, 2005, 09:44:40
Does anyone have any idea why setDisplayConfiguration() doesn't work? It always gives me the ugly "failed to set device gamma" error. Still it seems to work fine in other LWJGL games that I've tried, like Alien Flux (so I don't think it's a hardware / driver issue). Is there some special place where I need to call it? What's going on? I'm confused, help me!  :(
Title: Fading effects?
Post by: elias on November 01, 2005, 10:01:43
setDeviceConfiguration can fail because the values are out of bounds in some platform dependent way. I never use it myself, but if you want to use it, try altering the values until you get a positive result.

- elias