Latest Posts

Changes in ImplementOpenGl

Revision Differences of Revision 4

# Status ¶

## Current State ¶
- Experimental: I pushed a first Version where opengl rendering works ¶

## Working on ¶
The restructuring of the renderer: ¶

-
OpenGL and SDL is separated now.
-
Class Surface is virtual and code compiles partly again ¶

- Get everything
. ¶
- The Code compiles and links. ¶
- The menu works
compile and link again ¶
- get image loading and game rendering working ¶

## To be done ¶
- reimplement image Loading ¶
- reimplement
tely for sdl and partly with opengl. ¶
- The game and terrain renderer does not work for opengl or sdl ¶
- Text rendering works only partly. ¶

## Working on ¶

- Fix terrain/game rendering for sdl and implement for opengl ¶
- Fix rest of the font/text rendering code ¶

## To be done ¶
- fix text/
font handling ¶
- reimplement drawing the game ¶
- reimplement drawing the minimap ¶
- merge with trunk and modify cmake ¶

(gameview and minimap will get their own class soon) ¶

# Howto test it: ¶
This branch is outdated. It's a proof of concept only. ¶

- get the branch ¶
- create a build directory ¶
- invoke cmake /path/to/source -DCMAKE_CXX_FLAGS="-DUSE_OPENGL -DHAS_OPENGL" -DCMAKE_EXE_LINKER_FLAGS=-lGL ¶
- run make us usual ¶

Do not report bugs in the current state. At the moment it's just an experiment. ¶

## Implementation ¶
The current code relies on SDL software rendering a lot. The class Surface is used for image handling and rendering. This class exposes some SDL internals to widelands and these are use in some places. There is a class Graphic which is the main interface between widelands and the graphic system. Currently there is some game related code in the Surface, Graphic and Rendertarget classes. ¶

The first step was making Surface a Virtual base class which does not expose any SDL internal to the rest of widelands. There are two classes which inherit from Surface and implement actual renderers. They are called SurfacedSDL and SurfaceOpenGL. Everything from the game should use only the virtual class Surface and the global object g_gr of class Graphic. Graphic will have methods to create Surfaces and to Load Images to Surfaces. Rendering the game and the minimap code is currently scattered somehow over some classes and source files. I will move this code to an own class. ¶

Everything related to rendering now goes to graphic/render subdirectory. Everything else except some classes from graphic/ subdirectory (Graphic and perhaps font_handler) should not know anything about these different renderers. ¶

# Links ¶
[Branch on launchpad](https://code.launchpad.net/~timo-wingender/widelands/graphicsystem-opengl)