Stuck on things I shouldn't be stuck on as always :D.
I have been messing around with glBlendFunc to create a flashlight/spotlight effect on a tilemap, everything works exactly how I would expect apart from it always creates a white background color where no tiles exist (regardless of my glClearColor which is what I would expect it to show?).
Here is a picture to show what I mean http://puu.sh/2SS1C.png
(see the background above the trees is white whatever I seem to do, I am guessing my first blending call is wrong). I would like it to be black to match the texture without actually having to put tiles there.
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT);
glBlendFunc(GL_ONE, GL_ZERO); // Might be the problem but not sure what else to set it as
ApplySurface(0,0,Dark);
ApplySurface(320,380,Light);
glBlendFunc(GL_DST_COLOR, GL_ZERO);
map.Show();
SDL_GL_SwapBuffers();
Tried replacing my first blend function with that, didn't seem to change anything. Will try experimenting more with the AlphaFunc but I think it's a result of my dark texture reacting with the background...but not 100%.
Let me know if anyone has any more ideas as well, thanks.
Seems to work fairly well basing everything off of alpha values instead of colors (so the background wont get involved). Thanks for the advice as well.