erobrazerzkidai.blogg.se

Quake ii for android
Quake ii for android




quake ii for android

This was fairly easy to do, with the exception of aliasing warnings related to the "Quake C" interpreter FFI.Ĭonverted the graphics from OpenGL to OpenGL ES Also, as part of the general cleanup I fixed all gcc warnings. The game remains 99% pure C, since I didn't rewrite I like the ability to use classes occasionally. I did this early in development, because I'm more comfortable writing in C++ than in C. It would be cleaner if this was communicated by a separate API call. This is used to tell the game when the screen size has changed. Similarly, the "step" function takes arguments that give the current screen size. This might better have been handled by providing a series of Java methods that the C code could call back.

quake ii for android

That it wants ASCII character events, because it is in menu / console mode.That the game wants raw PC keyboard events, because it is in normal gameplay mode.For example the "step" function returns a trinary value indicating:

QUAKE II FOR ANDROID HOW TO

At the time I developed this game I didn't know very much about how to use JNI, so I didn't implement any C-to-Java calls, preferring to pass status back in return values.

  • handle an input event (by setting variables that are read during the "step" call.).
  • step - which does a game step, and draws a new frame.
  • The interface between Java and C is pretty simple.
  • Running the game in its own rendering loop, separate from the UI threadĪnd then I use C++ for the rest.
  • I was able to make the game work by using Java for: What's different about this particular port of Quake?Ĭonverted the original application into a DLLĪndroid applications are written in Java, but they are allowed to call native languge DLLs, and the native language DLLs are allowed to call a limited selection of OS APIs, which include OpenGL ES and Linux File I/O. (Porting Quake II or Quake III is left as an exercise for the reader.






    Quake ii for android