Fading effects?

Started by Unknown, October 27, 2005, 08:51:36

Previous topic - Next topic

Unknown

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

oNyx

Draw stuff... disable texturing... set the color to something with alpha... draw a quad ontop.

Unknown

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

elias

Yep, glColor4f is your friend.

- elias

Unknown

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!  :(

elias

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