I am using OpenGL ES 1.1 // INITIALIZATION glEnable(GL_TEXTURE_2D) glEnable(GL_BLEND) glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) // Load Test Texture glGenTextures(1, &textureTest) glBindTexture(GL_TEXTURE_2D, textureTest) // Bind Our Texture glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) // Linear Filtered glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) // Linear Filtered = glClear(GL_COLOR_BUFFER_BIT) glLoadIdentity() // Render to texture glBindFramebufferOES(GL_FRAMEBUFFER_OES, FBO) // Draw test texture glBindTexture(GL_TEXTURE_2D, textureTest) glEnableClientState(GL_VERTEX_ARRAY) glEnableClientState(GL_TEXTURE_COORD_ARRAY) glVertexPointer(3, GL_FLOAT, 0, vertices) glTexCoordPointer(2, GL_FLOAT, 0, texCoords) glDrawArrays(GL_TRIANGLE_STRIP, 0, 4) glDisableClientState(GL_VERTEX_ARRAY) glDisableClientState(GL_TEXTURE_COORD_ARRAY) glBindTexture(GL_TEXTURE_2D, 0) //disable any bound textures. If i comment out the fbo code and draw the embedded texture directly to the screen, that works. I am creating a framebuffer, drawing a texture to the fbo, and then drawing the fbo texture to the screen but nothing displays. I have read numerous articles/tutorials online regarding drawing a texture to a framebuffer in opengl, but I am having no luck getting it to work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |