From f9574c5f890f3205efa4ab4ff509223e2a7c6b74 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 23 Jun 2010 17:45:06 +0800 Subject: [PATCH] st/egl: Make api_OpenGL support OpenGL ES. This allows api_OpenGL.so to support OpenGL ES. --- src/gallium/targets/egl-apis/Makefile | 8 +++++++- src/gallium/targets/egl-apis/api_GL.c | 20 +++++++++++++++++++- src/gallium/targets/egl-apis/api_GLESv1_CM.c | 4 ++-- src/gallium/targets/egl-apis/api_GLESv2.c | 5 ++--- src/gallium/targets/egl-apis/api_OpenVG.c | 2 +- 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/gallium/targets/egl-apis/Makefile b/src/gallium/targets/egl-apis/Makefile index 88915bfc5ec..1275cc79b24 100644 --- a/src/gallium/targets/egl-apis/Makefile +++ b/src/gallium/targets/egl-apis/Makefile @@ -15,6 +15,12 @@ GLESv1_CM_INCLUDES := $(GL_INCLUDES) GLESv2_INCLUDES := $(GL_INCLUDES) OpenVG_INCLUDES := -I$(TOP)/src/gallium/state_trackers/vega -I$(TOP)/src/gallium/include +# cflags +GL_CFLAGS := $(API_DEFINES) +GLESv1_CM_CFLAGS := +GLESv2_CFLAGS := +OpenVG_CFLAGS := + # system libs GL_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) GLESv1_CM_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv1_CM_LIB) @@ -46,7 +52,7 @@ OpenVG_OBJECTS := api_OpenVG.o default: $(OUTPUTS) api_%.o: api_%.c - $(CC) -c -o $@ $< $($*_INCLUDES) $(DEFINES) $(CFLAGS) + $(CC) -c -o $@ $< $($*_INCLUDES) $($*_CFLAGS) $(DEFINES) $(CFLAGS) define mklib $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ diff --git a/src/gallium/targets/egl-apis/api_GL.c b/src/gallium/targets/egl-apis/api_GL.c index 6d172745c01..676300b0cc1 100644 --- a/src/gallium/targets/egl-apis/api_GL.c +++ b/src/gallium/targets/egl-apis/api_GL.c @@ -1,7 +1,25 @@ #include "state_tracker/st_gl_api.h" +#if FEATURE_GL PUBLIC struct st_api * -st_api_create_OpenGL() +st_api_create_OpenGL(void) { return st_gl_api_create(); } +#endif + +#if FEATURE_ES1 +PUBLIC struct st_api * +st_api_create_OpenGL_ES1(void) +{ + return st_gl_api_create_es1(); +} +#endif + +#if FEATURE_ES2 +PUBLIC struct st_api * +st_api_create_OpenGL_ES2(void) +{ + return st_gl_api_create_es2(); +} +#endif diff --git a/src/gallium/targets/egl-apis/api_GLESv1_CM.c b/src/gallium/targets/egl-apis/api_GLESv1_CM.c index 825fdac2150..0c8de8992f3 100644 --- a/src/gallium/targets/egl-apis/api_GLESv1_CM.c +++ b/src/gallium/targets/egl-apis/api_GLESv1_CM.c @@ -1,7 +1,7 @@ #include "state_tracker/st_gl_api.h" PUBLIC struct st_api * -st_api_create_OpenGL_ES1() +st_api_create_OpenGL_ES1(void) { - return st_gl_api_create(); + return st_gl_api_create_es1(); } diff --git a/src/gallium/targets/egl-apis/api_GLESv2.c b/src/gallium/targets/egl-apis/api_GLESv2.c index 5c773aaf93b..87b3e65e239 100644 --- a/src/gallium/targets/egl-apis/api_GLESv2.c +++ b/src/gallium/targets/egl-apis/api_GLESv2.c @@ -1,8 +1,7 @@ #include "state_tracker/st_gl_api.h" PUBLIC struct st_api * -st_api_create_OpenGL_ES2() +st_api_create_OpenGL_ES2(void) { - /* linker magic creates different versions */ - return st_gl_api_create(); + return st_gl_api_create_es2(); } diff --git a/src/gallium/targets/egl-apis/api_OpenVG.c b/src/gallium/targets/egl-apis/api_OpenVG.c index f85ebea8a1c..e29a2374792 100644 --- a/src/gallium/targets/egl-apis/api_OpenVG.c +++ b/src/gallium/targets/egl-apis/api_OpenVG.c @@ -2,7 +2,7 @@ #include "vg_api.h" PUBLIC struct st_api * -st_api_create_OpenVG() +st_api_create_OpenVG(void) { return (struct st_api *) vg_api_get(); } -- 2.30.2