fixes for OpenGL ES platforms

This commit is contained in:
Eduardo Bart 2012-05-13 09:48:19 -03:00
parent 5e176ca6d1
commit e2dd71185b
2 changed files with 16 additions and 3 deletions

View File

@ -27,9 +27,22 @@
#if OPENGL_ES==2 #if OPENGL_ES==2
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#elif OPENGL_ES==1 #elif OPENGL_ES==1
#include <GLES2/gl2.h>
#include <GLES/gl.h> #include <GLES/gl.h>
#define GL_FRAMEBUFFER 0x8D40
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_STREAM_DRAW 0x88E0
#define GL_STATIC_DRAW 0x88E4
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_VERTEX_SHADER 0x8B31
#define GL_COMPILE_STATUS 0x8B81
#define GL_INFO_LOG_LENGTH 0x8B84
#define GL_LINK_STATUS 0x8B82
typedef char GLchar;
// define OpenGL ES 2.0 API just to make compile, it wont actually be used // define OpenGL ES 2.0 API just to make compile, it wont actually be used
inline void glBindFramebuffer (GLenum target, GLuint framebuffer) { } inline void glBindFramebuffer (GLenum target, GLuint framebuffer) { }
inline void glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers) { } inline void glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers) { }

View File

@ -224,8 +224,8 @@ SoundSourcePtr SoundManager::createSoundSource(const std::string& filename)
streamSource->setSoundFile(soundFile); streamSource->setSoundFile(soundFile);
source = streamSource; source = streamSource;
#ifdef __linux #if defined __linux && !defined OPENGLES
// due to OpenAL implementation bug stereo buffers are always downmixed to mono on linux systems // due to OpenAL implementation bug, stereo buffers are always downmixed to mono on linux systems
// this is hack to work around the issue // this is hack to work around the issue
// solution taken from http://opensource.creative.com/pipermail/openal/2007-April/010355.html // solution taken from http://opensource.creative.com/pipermail/openal/2007-April/010355.html
if(soundFile->getSampleFormat() == AL_FORMAT_STEREO16) { if(soundFile->getSampleFormat() == AL_FORMAT_STEREO16) {