Common structures: typedef float[4][4] MATRIX; Stored in OpenGL format (not transposed like in D3D) typedef struct { float x,y,z; float nx,ny,nz; Normal float u,v; Texture coords (D3D wants these float) UINT32 color; } VERTEX; typedef struct { int v[4]; Vertex indices int texture; Texture index in cache int flags; Polygon flags (mirroring, etc.) int transparency; int luminance; ... Everything else I forgot to add... } POLYGON; The polygon entries are changed into more hardware-friendly format in the renderer (sorting by textures to avoid expensive state-changes, etc.) This works with VROM-models, but not with dynamic vertex data. osd_renderer_init(all those r3d memory addresses) should we give the Win32 HWND as an osd-independent param (void*) ????? all those mem addresses in a single struct ???? osd_renderer_shutdown(void) osd_renderer_set_mode(bool fullscreen, int width, int height) osd_renderer_unset_mode(void) return to windowed mode ? osd_renderer_update_frame(void) draw the already rendered frame osd_renderer_get_layer_buffer(int, UINT8**, UINT*) osd_renderer_free_layer_buffer(int) osd_renderer_get_layer_format(struct* format) to remove the two-way dependency from renderer and tilegen. We shouldn't have a call to tilegen from the renderer. osd_renderer_remove_textures(UINT, UINT, UINT, UINT) or could the correct name be something like invalidate_cached_texture ? osd_renderer_clear(...) clear the frame osd_renderer_render_layer(int layer) render a 2d layer osd_renderer_begin_scene() osd_renderer_end_scene() D3D needs to call begin_scene and end_scene before and after rendering the scene osd_renderer_push_matrix(MATRIX) osd_renderer_pop_matrix() osd_renderer_matrix_multiply(MATRIX) osd_renderer_matrix_translate(x,y,z) osd_renderer_empty_matrix_stack() Matrix stack operations osd_renderer_set_fog(struct FOG_PARAMS) osd_renderer_set_viewport(struct VIEWPORT_PARAMS) osd_renderer_set_projection(projection params) osd_renderer_set_coord_sys(MATRIX) osd_renderer_set_light(int light_num,struct LIGHT_PARAMS) osd_renderer_cache_model(POLYGON array, VERTEX array) maybe use the the address as a hash table key ??? osd_renderer_render_model(...) draw a model. use the address to check if the model is already in cache. We also need a way to render non-cached models (dynamic vertex data). That will be hard to get fast.