• Advertisement
  • entries
  • comments
  • views

About this blog

This is a journal of my own mini game engine's development. The engine is called Mini-Engine because it is developed only by me alone.

Entries in this blog

The Battle Continues

It has been long since I updated my engine. This is mostly due to school. I am hoping to write more after my final exams. This should be an exciting xmas!

So far I have decided to go with OpenGL. However, I am still struggling to choose which version to support. I'd probably going to use shader version 130 with OpenGL 3.0. I also decided to include a physics engine inside my ME. The good news is that I already have most of the utility functions written. With those, a functioning aggregated-mass particle engine is complete. Hopefully, I will come up with a good shader this xmas break.

OpenGL and DirectX

It seems as I continue my journey into M.E. development, I cannot devote 100% attention if I were to implement OpenGL and DirectX at the same time. Therefore, I must make a choice on which to focus. In the end, I chose OpenGL and this is because many platforms use it! More over, I am very excited about OpenGL 3.x and 4.x, which are newer versions of OpenGL. Finally OpenGL will support many features DirectX 10/11 has, and it is cross platform!

Even with school going on, I still managed to transform from DirectX into OpenGL relatively quickly. There are some bumps here and there, but nothing really major. However, I do want to point out some valuable (at least to me) experiences so that anyone who's learning OpenGL won't be wasting so much time on.

  1. Always include windows.h BEFORE gl.h or glu.h. The first time I got this error saying some values in gl.h and glu.h is not right, I freaked. Then I found out that some of the values requires the include of windows.h
  2. Use freeglut instead of glut which is a more recent version of glut library.
  3. If you are using Microsoft Visual Studio like me, you will want to know your directories! Particularly, "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\". If you have VS 2010, then you will have "v7.0A", else if you have say 2008 version, you will get "v6.0" if I remembered correctly. Anyway, inside that folder, all your OpenGL header files (such as gl.h, glu.h etc) goes into the "Include" folder. All your library files (such as glut.lib etc) goes into the "Lib" folder. All the other dll files should go into either "Bin" or "C:\Windows\System32\"
  4. Don't forget to set your linker correctly in your project
  5. Also under "General" of your project property, set your "Character Set" to "Multi Byte Character Set" if you are getting String errors.
  6. If you are programming on windows, DO NOT USE "X11" includes, because they are for Linux.
  7. If you are again programming on windows, you might use wglext.h which also requires gl/gl.h to be included BEFORE wglext.h is included. Also don't forget that gl/gl.h requires windows.h to be included BEFORE.

Those should be some good tips to debug your first OpenGL application! Good luck to you guys and me!
Ever since my first programming experience, I have been taught to use the console. Regardless of the language I program in, I always find it intuitive to print out values with simple functions such as "println(), printf(), cout <<..." and so on. However, to program something like a game engine, I would have to leave that world and enter the world of complicated but simple to use GUI oriented interface. Values don't just show up in some console, but may also show up in error windows or warning signs. It is now:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, PSTR CMDLine, int showCMD){...}not:
int main(int argc, char** argv){...}
This is good bye my dear console! But this is not good bye forever :)
  • Advertisement