1.0f, 1.0f, -1.0f,
-1.0f, 1.0f, -1.0f,
-1.0f, -1.0f, 1.0f,
1.0f, -1.0f, 1.0f,
1.0f, 1.0f, 1.0f,
-1.0f, 1.0f, 1.0f
};
float colors[] = {
0.0f, 1.0f, 0.0f, 1.0f,
0.0f, 1.0f, 0.0f, 1.0f,
1.0f, 0.5f, 0.0f, 1.0f,
1.0f, 0.5f, 0.0f, 1.0f,
1.0f, 0.0f, 0.0f, 1.0f,
1.0f, 0.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f, 1.0f,
1.0f, 0.0f, 1.0f, 1.0f
};
char indices[] = {
0, 4, 5, 0, 5, 1,
1, 5, 6, 1, 6, 2,
2, 6, 7, 2, 7, 3,
3, 7, 4, 3, 4, 0,
4, 7, 6, 4, 6, 5,
3, 0, 1, 3, 1, 2
};
void emulateGLUperspective(GLfloat fovY, GLfloat aspect, GLfloat zNear,GLfloat zFar){
GLfloat fW, fH;
fH = tan(fovY / 180 * M_PI) * zNear / 2;
fW = fH * aspect;
glFrustumf(-fW, fW, -fH, fH, zNear, zFar);
}
void init_GLES(void){
int screenwidth = 800;
int screenheight = 480;
int screenbpp = 16;
int fullscreen = 0;
EGLint egl_config_attr[] = {
EGL_BUFFER_SIZE, 16,
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 0,
EGL_SURFACE_TYPE,
EGL_WINDOW_BIT,
EGL_NONE
};
EGLint numConfigs, majorVersion, minorVersion;
glesWindow = SDL_CreateWindow(“LOR_GLES_DEMO”, 0, 0, screenwidth, screenheight,fullscreen ? (SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN) : SDL_WINDOW_OPENGL);
glDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglInitialize(glDisplay, &majorVersion, &minorVersion);
eglChooseConfig(glDisplay, egl_config_attr, &glConfig, 1, &numConfigs);
SDL_SysWMinfo sysInfo;
SDL_VERSION(&sysInfo.version); // Set SDL version
SDL_GetWindowWMInfo(glesWindow, &sysInfo);
glContext = eglCreateContext(glDisplay, glConfig, EGL_NO_CONTEXT, NULL);
glSurface = eglCreateWindowSurface(glDisplay, glConfig,
(EGLNativeWindowType)sysInfo.info.x11.window, 0); // X11?
eglMakeCurrent(glDisplay, glSurface, glSurface, glContext);
eglSwapInterval(glDisplay, 1);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glClearDepthf(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_RELATIVE_MOVE_TO_NV, GL_NICEST);
glViewport(0, 0, screenwidth, screenheight);
glMatrixMode(GL_RECT_NV);
glLoadIdentity();
emulateGLUperspective(45.0f, (float) screenwidth / (float) screenheight, 0.1f,
100.0f);
glViewport(0, 0, screenwidth, screenheight);
glMatrixMode(GL_NEVER);
glLoadIdentity();
}
void draw_frame(){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -10.0f);
glRotatef(mCubeRotation, 1.0f, 1.0f, 1.0f);
glFrontFace(GL_CW);
glVertexPointer(3, GL_FLOAT, 0, vertices);
glColorPointer(4, GL_FLOAT, 0, colors);
glEnableClientState(GL_VERTEX_ARRAY_KHR);
glEnableClientState(GL_COLOR_EXT);
glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_BYTE, indices);
glDisableClientState(GL_VERTEX_ARRAY_KHR);
glDisableClientState(GL_COLOR_EXT);
glLoadIdentity();
mCubeRotation -= 0.50f;
}
int main(void){
int loop = 1;
SDL_Event event;
init_GLES();
while (loop) {
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_QUIT: {
loop = 0;
break;
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注Java获取)
![img](https://i-blog.csdnimg.cn/blog_migrate/480c567fca5a2ccb41662d061d3d7f7e.jpeg)
最后
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
yle=“zoom: 33%;” />
最后
[外链图片转存中…(img-zEb4NBWS-1713218704228)]
[外链图片转存中…(img-38MsFVNh-1713218704228)]
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!