Rendering Text!
I somehow feel happy about finally being able to render Text ;)
I'm using the Freetype Library and OpenGL. I thought about using SDL TTF, but somehow I ended up deciding on this :)

seen from United States
seen from United States

seen from United States

seen from United States

seen from United States
seen from India
seen from China
seen from United States
seen from China
seen from China
seen from Venezuela

seen from United States
seen from United States
seen from United States

seen from France
seen from United States

seen from United States
seen from Netherlands
seen from Denmark

seen from United States
Rendering Text!
I somehow feel happy about finally being able to render Text ;)
I'm using the Freetype Library and OpenGL. I thought about using SDL TTF, but somehow I ended up deciding on this :)

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
World optimization (lvl 1): Bugs
Okay, here are a few bugs in order of appearance:
It wouldn’t bother if you could only look at the world from above, but… imagine a mountain looking like this! (I also like how you can see the different layers of block types ;) )
(You can see exactly how high the world is at the moment in this screenshot [18 blocks])
You can’t actually fall through the gaps, because world collision works with the not optimized world data.
I just thought I'd share this with you, because I think these bugs looked kind of cool.
World optimization: level one
One of my last posts was about back face culling. This was because of my performance problem while trying to render 130 000 blocks smoothly. I also said I was going to optimize the world data a little bit before applying shaders (I didn’t know I was already using the standard OpenGL shaders ;) ).
Well… I did! I am now only rendering visible blocks, what means that Mineshooter is now faster than even before I increased the map height. I am not going to make own shaders yet, though. I don’t like how my world looks like, so I already started to make the map generation work with a height-map.
But I promise to learn how to write shaders with GLSL after I optimized the world-data to level 2 (making a mesh out of each chunk).
(btw: Got some really fun bugs. I will post a few very soon!)
back-face culling
I recently found a tutorial on back-face culling. It means telling OpenGL not to draw invisible faces (faces on the back side ;) ) of a mesh, which does speed up the rendering a lot.
I was looking for something like this after I increased the height of the world in Mineshooter from 4 to 10 and suddenly had to render about 130.000 blocks instead of 25.000 and therefore got a major performance problem.
So I found that enabling back-face culling in OpenGL is very easy. Just write the following lines where you initialize OpenGL:
glEnable(GL_CULL_FACE); //Enable face-culling
glCullFace(GL_BACK); //Cull back-faces. You could also cull front-faces
glFrontFace(GL_CCW); //drawing counter-clockwise... (GL_CW for Clockwise...)
That helped a lot. But before applying shaders I am going to optimize the world a bit.
Mouselook and SDL - Code
Okay, here is some code for mouselook with SDL...
___________________________________________________________________
struct {    int x, y;    //In this case: the position where the mouse is held at    bool trap; //flag for holding mouse at one place } mouse; void MouseMotion(){    /* Set x and y to the current mouse position */    int x, y;    SDL_GetMouseState(&x, &y);    int xdiff = x - mouse.x; //Calculate difference in x    int ydiff = y - mouse.y; //Calculate difference in y    /* rotate camera relative to what it was before */    Cam->relRot( (float) ydiff, (float) xdiff, 0.0f); //Alternative: use gluLookAt(...);    // ( xdiff and ydiff are in the right place... comment, if you need explaination)    if (mouse.trap){        //Reset Mouse Position to middle of screen        SDL_WarpMouse(mouse.x, mouse.y); //Set Cursor    } } int main (){    //Initialization...blabla    bool done = false;    while(!done) {       SDL_Event event;       while(SDL_PollEvent(&event)) {          switch(event.type)             case SDL_MOUSEMOTION:                MouseMotion();                break;             //... ther Events ...       }       //... do other things    }    //End }
___________________________________________________________________
This code is only a bunch of fragments to keep it simple. "Cam" is a camera class I created to handle every camera-related stuff (Position/Rotation...). "RelRot" adds the given vector values to the rotation-vector of the camera. When rendering the sceen, I rotate the Projection Matrix by the rotation-vector of the camera.
btw: this is not exacly the code I use in Mineshooter. I use more classes there ;)
Anyway, I hope this helps somebody out there :)

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Fixed the SDL and Mouselook Problem
After spending hours trying to figure out why my mouselook function didn't work with SDL, I finally got a solution.
The problem was that I didn't use SDL_PumpEvents() before calling SDL_GetMouseState(). But if I do that I get the next problem: my Keyboard Events get delayed because the event-queue got enormous.
In the end I decided to put the mouse motion handling in where I handled the SDL-events. That worked. I'll post some code very soon, so if somebody has a similar problem, he/she doesn't need to spend hours on it, as I did.
Greetings, Squareys
Mineshooter with SDL...
Almost done with rewriting Mineshooter to work with the Simple DirectMedia Layer Library. Still have a few problems with the mouselook, but I should be able to work out a solution very soon.
SDL is quite simple. I now have about 150 lines less than when I used the Windows MFC.
Mineshooter with SDL?
I'm currently working on learning SDL and am also thinking about making my Mineshooter Projekt use SDL. Does anybody have experience with programming SDL-Applications and would advice against using it?