Here you can see how to use OpenGL library to create a simple terrain using two bitmaps. It's great!
In the WinMain function the main window which will be shown will be defined. Then we try to change the display resolution to 800 x 600 to render our terrain. To do this I used the DEVMODE structure to define the new screen resolution. Then I called ChangeDisplaySettings funtion to change the display resrolution. After creating the window simply we have a loop to survive the program and inside that we call the Render() function which renders our scene.
In the Render() function we shall define different objects. First of all we define the camer behaviour. using the Mouse in Y direction we can get closer or farther away from our terrain. So I used mouseY for this feature. Then using glClear() and gluLookAt we clear our display and set the camera position. Afterwards using glBindTexture() we add the terrain bitmap as the land to our scene. Then between glBegin() and glEnd() we draw our terrain vertexes using glVertex3f() function.
I hope you like it.
File list:
Code
...\green.bmp

...\OpenGLWindow.cpp
...\OpenGLWindow.sln
...\OpenGLWindow.vcproj
...\Terrain2.bmp

...\vkgllib.h