Project’s application class which inherits the base application and does some project-specific things, including initialization of resources, event handling and rendering to the screen.Base application class, which uses SDL2 to create a window, OpenGL context, setups logging, and manages a handful of unrelated stuff, and a. My engine’s core application code looked like this: we have a Stage 1: Preparations Application abstraction Make an Android app that creates an OpenGL-renderable surface, loads said library and calls the appropriate functionsīefore I could do that, I needed some refactoring to be done.Build my engine & game into a shared library that exposes some setup routines, event handlers and a render callback through JNI.C++) OpenGL rendering inside an Android app (after all, that’s what I do at work), so…how hard it can be? Oh, sweet summer child. I mean, I don’t need all the stuff that SDL2 supports, and I already know a lot about using native (i.e. So, if I’m not using SDL2, what do I use instead? At this point, a scary idea visited my deranged mind: I can actually do all this myself. They don’t have any documentation on how to use their thing, only a tiny single-file example. They pretend that you still own the application loop (which you don’t – Android owns it!) and create a separate thread with a compex inter-thread communication system to make it work. They rely on you using SDL_main (a function you need to define in order to work with SDL because they define main themselves but this main is in a library different from libSDL namely libSDL_main and they conveniently do #define main SDL_main so that it looks like you’re just writing main but then you get linker errors about main not being there…), which I’ve successfully avoided doing all these years. Long story short, I didn’t like it at all. window & OpenGL context management, and audio output) for desktop builds, and I’ve heard you can use SDL2 to build for android directly, so I decided to look into how they do it. Now that we believe this whole endeavour is worth a try, how are we gonna do it? I’m using SDL2 (a platform abstraction library, used for e.g. The feeling of running your project on a device that it couldn’t run on before is extremely satisfying. Is it a good step towards supporting more platforms, like web (using WASM and Emscripten)īut honestly the most important reason is just for fun.If I ever want to actually make mobile games, I will be able to use my beloved engine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |