![]() ![]() GlBindTexture(GLenum(GL_TEXTURE_2D), texture) GlUniformMatrix4fv(loc3, 1, GLboolean(GL_FALSE), &matrix) Let loc3 = glGetUniformLocation(texShader, "matrix") Let loc1 = glGetUniformLocation(texShader, "s_texture") This has been tested with two manually loaded pngs (using no buffer changes) and works great. Then as far as rendering I have some things going on.Ī code that theoretically renders any texture full screen. GlBindFramebuffer(GLenum(GL_FRAMEBUFFER), GLenum(old_fbo)) ![]() Print("DIDNT GO WELL WITH", width, " ", height) If (status != GLenum(GL_FRAMEBUFFER_COMPLETE)) Let status = glCheckFramebufferStatus(GLenum(GL_FRAMEBUFFER)) GlFramebufferTexture2D(GLenum(GL_FRAMEBUFFER), GLenum(GL_COLOR_ATTACHMENT0), GLenum(GL_TEXTURE_2D), tex, 0) GlTexImage2D(GLenum(GL_TEXTURE_2D), 0, GL_RGBA, GLsizei(width), GLsizei(height), 0, GLenum(GL_RGBA), GLenum(GL_UNSIGNED_BYTE), nil) GlBindTexture(GLenum(GL_TEXTURE_2D), tex) GlBindFramebuffer(GLenum(GL_FRAMEBUFFER), framebuffer) GlGetIntegerv(GLenum(GL_FRAMEBUFFER_BINDING), &old_fbo) Anyway here is my swift interpretation of the code from that topic. Unfortunately they mention something about the power of two (im assuming with regards to resolution) but I don’t know how to fix it. ![]() I have been trying to follow another topic on it. I am in OpenGL es 2.0 with glKit trying to render to iOS devices.īasically my goal is to instead of drawing to the main buffer draw to a texture. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |