Re: [Super-tux-devel] Surface class
Brought to you by:
wkendrick
From: Ingo R. <gr...@gm...> - 2004-04-13 12:28:46
|
Ricardo Cruz <ri...@ae...> writes: > I don't know who redesigned the texture.cpp code, but I don't agree > with having two separate classes for both SDL and OpenGL. Thats pretty much the same as it was before. Move gl_texture to SurfaceSDL and you have exactly the same as before. It makes not really a difference if you dispatch something manually via a function pointer or via C++ vtable. > The code would stay clean and simple, if they just shared the same > class and there was a function pointing out for the right functions > to use. It is far more cleaner to have the function seperated in to class then have one class and twigle manually with function pointers. > I don't even think this code will allow for a videomode change. Sure, it does. The user code just sees 'Surface', while Surface dispatches everything to SurfaceSDL or SurfaceOpenGL, which is pretty much the same as the pointer-stuff that was there before. So all you need to do is to let Surface switch from SurfaceSDL to SurfaceOpenGL on video mode changes, which shouldn't be much of a big problem if you add some code to Surface that caches the data needed to create the surface (ie. filename and size, or another surface). -- WWW: http://pingus.seul.org/~grumbel/ JabberID: gr...@ja... ICQ: 59461927 |