summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/egl-apis
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-06-23 17:45:06 +0800
committerChia-I Wu <[email protected]>2010-06-29 17:16:19 +0800
commitf9574c5f890f3205efa4ab4ff509223e2a7c6b74 (patch)
tree630d25adafc41fbba6ca81f641490d8fa05b5970 /src/gallium/targets/egl-apis
parent57c654324f5577d30c5239cd0c2c3eb7ad474143 (diff)
st/egl: Make api_OpenGL support OpenGL ES.
This allows api_OpenGL.so to support OpenGL ES.
Diffstat (limited to 'src/gallium/targets/egl-apis')
-rw-r--r--src/gallium/targets/egl-apis/Makefile8
-rw-r--r--src/gallium/targets/egl-apis/api_GL.c20
-rw-r--r--src/gallium/targets/egl-apis/api_GLESv1_CM.c4
-rw-r--r--src/gallium/targets/egl-apis/api_GLESv2.c5
-rw-r--r--src/gallium/targets/egl-apis/api_OpenVG.c2
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();
}