comparison pytouhou/ui/opengl/renderer.pyx @ 559:1be60813f7cb

Get OpenGL ES 2.0 to work thanks to libepoxy. PCB textures will need swizzle in the shaders since BGRA isn’t natively supported on GLES.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 30 May 2014 16:40:36 +0200
parents 94725968dabb
children c759b97f4f81
comparison
equal deleted inserted replaced
558:94725968dabb 559:1be60813f7cb
27 glGenTextures, glTexParameteri, glTexImage2D, glGenRenderbuffers, 27 glGenTextures, glTexParameteri, glTexImage2D, glGenRenderbuffers,
28 glBindRenderbuffer, glRenderbufferStorage, glGenFramebuffers, 28 glBindRenderbuffer, glRenderbufferStorage, glGenFramebuffers,
29 glFramebufferTexture2D, glFramebufferRenderbuffer, 29 glFramebufferTexture2D, glFramebufferRenderbuffer,
30 glCheckFramebufferStatus, GL_FRAMEBUFFER, GL_TEXTURE_MIN_FILTER, 30 glCheckFramebufferStatus, GL_FRAMEBUFFER, GL_TEXTURE_MIN_FILTER,
31 GL_LINEAR, GL_TEXTURE_MAG_FILTER, GL_RGBA, GL_RENDERBUFFER, 31 GL_LINEAR, GL_TEXTURE_MAG_FILTER, GL_RGBA, GL_RENDERBUFFER,
32 GL_DEPTH_COMPONENT, GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, 32 GL_DEPTH_COMPONENT16, GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT,
33 GL_FRAMEBUFFER_COMPLETE, glClear, GL_COLOR_BUFFER_BIT, 33 GL_FRAMEBUFFER_COMPLETE, glClear, GL_COLOR_BUFFER_BIT,
34 GL_DEPTH_BUFFER_BIT, GLuint, glDeleteTextures, 34 GL_DEPTH_BUFFER_BIT, GLuint, glDeleteTextures,
35 GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW, glGenVertexArrays, 35 GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW, glGenVertexArrays,
36 glDeleteVertexArrays, glBindVertexArray) 36 glDeleteVertexArrays, glBindVertexArray)
37 37
334 NULL) 334 NULL)
335 glBindTexture(GL_TEXTURE_2D, 0) 335 glBindTexture(GL_TEXTURE_2D, 0)
336 336
337 glGenRenderbuffers(1, &self.rbo) 337 glGenRenderbuffers(1, &self.rbo)
338 glBindRenderbuffer(GL_RENDERBUFFER, self.rbo) 338 glBindRenderbuffer(GL_RENDERBUFFER, self.rbo)
339 glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, width, height) 339 glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height)
340 glBindRenderbuffer(GL_RENDERBUFFER, 0) 340 glBindRenderbuffer(GL_RENDERBUFFER, 0)
341 341
342 glGenFramebuffers(1, &self.fbo) 342 glGenFramebuffers(1, &self.fbo)
343 glBindFramebuffer(GL_FRAMEBUFFER, self.fbo) 343 glBindFramebuffer(GL_FRAMEBUFFER, self.fbo)
344 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, self.texture, 0) 344 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, self.texture, 0)