Commit 26624224 authored by Ronan's avatar Ronan
Browse files

better usage of glew init (avoid call in generic_opengl_display)

parent da5b10f5
......@@ -21,21 +21,20 @@
#define msogl_h
#ifdef __IOS
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#elif defined(__APPLE__)
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#elif defined(ANDROID)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#elif defined(_WIN32)
#if !defined(QOPENGLFUNCTIONS_H)
#include <GLES2/gl2.h>
#endif
#if !defined(QOPENGLFUNCTIONS_H)
#include <GLES2/gl2.h>
#endif
#elif !defined(QOPENGLFUNCTIONS_H) // glew is already included by QT.
#include <GL/glew.h>
#define GLEW_ENABLED 1
#include <GL/glew.h>
#endif
// =============================================================================
......
#include "opengl_functions.h"
// =============================================================================
#ifdef ANDROID
#define CAST(type, fn) (type)fn
#define CAST(type, fn) (type)fn
#else
#define CAST(type, fn) fn
#define CAST(type, fn) fn
#endif
void opengl_functions_default_init (OpenGlFunctions *f) {
#if !defined(_WIN32)
f->glActiveTexture = CAST(resolveGlActiveTexture,glActiveTexture);
f->glAttachShader = CAST(resolveGlAttachShader,glAttachShader);
f->glBindAttribLocation = CAST(resolveGlBindAttribLocation,glBindAttribLocation);
f->glBindTexture = CAST(resolveGlBindTexture,glBindTexture);
f->glClear = CAST(resolveGlClear,glClear);
f->glActiveTexture = CAST(resolveGlActiveTexture, glActiveTexture);
f->glAttachShader = CAST(resolveGlAttachShader, glAttachShader);
f->glBindAttribLocation = CAST(resolveGlBindAttribLocation, glBindAttribLocation);
f->glBindTexture = CAST(resolveGlBindTexture, glBindTexture);
f->glClear = CAST(resolveGlClear, glClear);
f->glClearColor = CAST(resolveGlClearColor, glClearColor);
f->glCompileShader = CAST(resolveGlCompileShader, glCompileShader);
f->glCreateProgram = CAST(resolveGlCreateProgram, glCreateProgram);
......
......@@ -56,15 +56,6 @@ typedef struct _FilterData FilterData;
static void ogl_init (MSFilter *f) {
FilterData *data = ms_new0(FilterData, 1);
#ifdef GLEW_ENABLED
if (glewInit() != GLEW_OK)
ms_error("glew init error");
else if (!GLEW_VERSION_2_0)
ms_error("glew 2.0 is required");
#endif
data->display = ogl_display_new();
data->show_video = TRUE;
......
......@@ -31,11 +31,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <X11/Xlib.h>
#include "opengles_display.h"
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include "opengles_display.h"
static void glxvideo_unprepare(MSFilter *f);
static bool_t createX11GLWindow(Display* display, MSVideoSize size, GLXContext* ctx, Window* win);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment