So apparently im not too sure how to include Open GL in my SDL application
所以显然我不太确定如何在我的SDL应用程序中包含Open GL
I have:
if _ANDROID_
#include <GLES2/gl2.h>
#include <GLES2/glext.h>
but when I use GLUint I get
但是当我使用GLUint时,我得到了
GLuint does not name a type
GLuint没有命名类型
My android.mk includes
我的android.mk包括
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog
and i am building for android platform 10 (** **)
我正在构建Android平台10(** **)
APP_PLATFORM := android-10
APP_ABI := armeabi-v7a armeabi x86
So i am not too sure what i am doing wrong
所以我不太清楚我做错了什么
(Added the rest of the file that is having problems:)
(添加了有问题的文件的其余部分:)
#pragma once
#include <stdlib.h>
#include <iostream>
#include <random>
#include <cassert>
#include "vec2.h"
#include "vec3.h"
#include "vec4.h"
#include "mat4.h"
#include "transformations.h"
#if defined(_MSC_VER)
#include <windows.h>
#include <glew.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <SDL.h>
#include <SDL_ttf.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include <SDL_opengl.h>
#include <stdio.h>
#include <string>
#endif
#if __APPLE__
#include <SDL2/SDL.h>
#include <SDL2_image/SDL_image.h>
#include <SDL2_ttf/SDL_ttf.h>
#include <SDL2_mixer/SDL_mixer.h>
#endif
#if __ANDROID__
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <SDL_mixer.h>
#endif
// vec2 *screen;
/*const*/ // int sw;
/*const*/ // int sh;
#if __IPHONEOS__ || __ANDROID__
#define MOBILE 1
#endif
#if __MACOSX__ || __WINDOWS__ || __LINUX__
#define PC 1
#endif
#if __IPHONEOS__
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayOES(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysOES(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysOES(n, ids);
}
#elif TARGET_OS_MAC
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayAPPLE(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysAPPLE(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysAPPLE(n, ids);
}
#elif __ANDROID__
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
inline void glBindVertexArray(GLuint id1) {
glBindVertexArrayOES(id1);
}
inline void glGenVertexArrays(GLsizei n, GLuint *ids) {
glGenVertexArraysOES(n, ids);
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *ids) {
glDeleteVertexArraysOES(n, ids);
}
#endif // ANDROID
inline string get_path(string filename) {
char *base = SDL_GetBasePath();
string path(base + filename);
SDL_free(base);
//cout << "getting path " << path << endl;
return path;
}
using namespace std;
1 个解决方案
#1
0
I solved it by using
我用它来解决它
APP_STL := c++_static
instead of
#APP_STL := gnustl_static
#1
0
I solved it by using
我用它来解决它
APP_STL := c++_static
instead of
#APP_STL := gnustl_static