EasyGame Lesson01 – OpenGL Framework for WindowXP, Ubuntu and Android
This sample shows us how to build a OpenGL framework for windows, ubuntu and android with C++. Before you could use the source code here, you need to make sure that you already have installed Visual Studio IDE (for windows XP), Android SDK & NDK successfully. For the Ubuntu OS, you need to install the gcc, cmake, OpenGL library, XLib(I did not use the Qt to create windows, because I do not like using timer to update the game frame rate)
OpenGL Framework on windows
It seems everything touch on the windows OS, the situation becomes very easier. There are a lots of tutorial on the Internet that tell you how to create a win32 window, choose a proper pixel format and create a correct render context on the current display device. Here are several message or event you need to handle to make the whole things work. Most of them are platform dependent, to accomplish it, fixed workflow much be needed. That it is. The first time you come across win32 code, you will be so confused. But that is not the situation. if you were interesting on it, you could deep it. Otherwise, you could let it alone, and keep on the OpenGL part or game part.
OpenGL Framework on Android Device
Here, it seems all thing become even more easier. I put all rendering staff under the ‘Render’class (A android java library class that already write a surface renderer for us, we do not need to set up the render context now). What we need to it initialize our render staff when the render surface was created (in function “onSurfaceCreated”), and update and draw them under the “onDrawFrame”function.
After you have experienced set up OpenGL context on the windows, you will feel that both of those two process were very similar. We need to do all most the same thing to make them works. The most difficulty thing was that you are not family with the Linux C++ coding, you could not find some IDE as convincement as Visual Studio. And the GCC compiler will do some more strict checking than VS compiler, and VS compiler is a gent man and much more tolerant.
The best document about a software is the source code, and you could find the full document from here.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了