test openGL with shader
This commit is contained in:
parent
d14e684954
commit
fc30b0bb21
@ -16,7 +16,12 @@ LOCAL_LIBRARIES := etk freetype tinyxml libzip libpng parsersvg lua portaudio
|
|||||||
LOCAL_C_INCLUDES :=
|
LOCAL_C_INCLUDES :=
|
||||||
|
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
||||||
LOCAL_EXPORT_LDLIBS := -lGL -lGLU -lX11
|
LOCAL_EXPORT_LDLIBS := -lGL -lX11
|
||||||
|
# -lGLU -lGLEW
|
||||||
|
|
||||||
|
#http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Introduction
|
||||||
|
# needed package on linux : libgl1-mesa-dev libglew1.5-dev
|
||||||
|
|
||||||
|
|
||||||
LOCAL_CFLAGS := -Wno-write-strings \
|
LOCAL_CFLAGS := -Wno-write-strings \
|
||||||
-DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \
|
-DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \
|
||||||
|
@ -30,8 +30,13 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__TARGET_OS__Linux)
|
#if defined(__TARGET_OS__Linux)
|
||||||
|
// TO ENABLE THE SHADER api ...
|
||||||
|
#define GL_GLEXT_PROTOTYPES
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
/*
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
|
*/
|
||||||
#elif defined(__TARGET_OS__Android)
|
#elif defined(__TARGET_OS__Android)
|
||||||
#include <GLES/gl.h>
|
#include <GLES/gl.h>
|
||||||
#elif defined(__TARGET_OS__Windows)
|
#elif defined(__TARGET_OS__Windows)
|
||||||
|
@ -1178,6 +1178,19 @@ int main(int argc, char *argv[])
|
|||||||
etk::File myIcon = APP_Icon();
|
etk::File myIcon = APP_Icon();
|
||||||
SetIcon(myIcon);
|
SetIcon(myIcon);
|
||||||
|
|
||||||
|
GLuint shader;
|
||||||
|
/* creation */
|
||||||
|
shader = glCreateShader(GL_VERTEX_SHADER);
|
||||||
|
if(shader == 0) {
|
||||||
|
/* erreur de creation :( */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
/* utilisation ... */
|
||||||
|
/* suppression */
|
||||||
|
glDeleteShader(shader);
|
||||||
|
shader = 0;
|
||||||
|
|
||||||
|
|
||||||
// Run ...
|
// Run ...
|
||||||
X11_Run();
|
X11_Run();
|
||||||
// close X11 :
|
// close X11 :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user