Re: Flame Painter Dev Thread
Posted: Thu Feb 10, 2011 7:40 am
+1eatcomics wrote:OOOOOH PRETTY!!!!! *reaches out to touch*
The Next Generation of 2D Roleplaying Games
http://elysianshadows.com/phpBB3/
+1eatcomics wrote:OOOOOH PRETTY!!!!! *reaches out to touch*
SWEEETxiphirx wrote:After 10 straight hours of work, pounding my head against a wall, and everything else imaginable
:DFirzen wrote:SWEEETxiphirx wrote:After 10 straight hours of work, pounding my head against a wall, and everything else imaginable
Unsure atm, hopefully I have D: If I haven't, I'll just remove SDL, etc and install vs2010. Hopefully that works.pritam wrote:Very very nice :D
Did you sort out your dev environment btw, to release a demo?
Sanku.epicasian wrote:Dude, I have to say.
This looks amazing:D
agreed, that is sick son,epicasian wrote:Dude, I have to say.
This looks amazing:D
Why does this still seem so fucking cool? :Pxiphirx wrote:Aye, the OpenGL Port is here.
http://arse.voidteam.net/Personal/charr ... licker.zip
:D
Code: Select all
// -- Create FBO
//Create Rendering buffer
glGenRenderbuffersEXT(1, &flamesFBODepth); // Create render buffer
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, flamesFBODepth); // Bind the render buffer
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, sw, sh);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, flamesFBODepth);
//Create Texture
glGenTextures(1, &flamesFBOTexture);
glBindTexture(GL_TEXTURE_2D, flamesFBOTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, sw, sh, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
//FBO
glGenFramebuffersEXT(1, &flamesFBO);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, flamesFBO);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, flamesFBOTexture, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, flamesFBODepth);
//Check if it was successfully created
GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
return false;
//Unbind...
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindTexture(GL_TEXTURE_2D, 0);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
Code: Select all
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, flamesFBO);
glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT);
glClearColor (1.0f, 0.0f, 0.0f, 1.0f);
glLoadIdentity();
Code: Select all
glPopAttrib();
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
Code: Select all
glBindTexture(GL_TEXTURE_2D, flamesFBOTexture);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left
glTexCoord2f(1.0f, 1.0f);
glVertex3f(1.0f, 1.0f, 0.0f); // Top Right
glTexCoord2f(1.0f, 0.0f);
glVertex3f(1.0f, -1.0f, 0.0f); // Bottom Right
glEnd();
glBindTexture(GL_TEXTURE_2D, 0);