Grail icon indicating copy to clipboard operation
Grail copied to clipboard

Create a wrapper for the SDL ticks calls

Open ghost opened this issue 13 years ago • 3 comments

I think it would be a good idea to wrap up as much of the SDL calls as possible in wrappers to get us closer to being able to plug in a different rendering system at some point (waaayy in the future !).

What about a Timer class which we can use instances of to track time in time-sensitive objects like subtitles?

ghost avatar Feb 12 '12 11:02 ghost

Good idea. In order to consistently abstract from SDL we would also need to change the signature of the renderAt methods (and relatives) to get a Surface instead of a SDL_Surface (or some new class whatever).

As you say its good idea for the long run but I would not see this as an urgent task.

For the timer thingy: Yeah that would probably make sense, as we use time a lot. On the other hand, I think that wait_task basically is a timer. I.e. you can start it and ask it whether the time is over. (There is no multithreading/interrupt-like parallel execution, but its probably wise to avoid that as much as possible anyway).

Also we might want to think if want to further structure the sourcecode w.r.t. to directory structure and namespaces. We should not overdo this, but at least such an SDL abstraction layer could use a directory and namespace of its own then.

Droggelbecher avatar Feb 12 '12 20:02 Droggelbecher

I have to look into wait task, sounds interesting

ghost avatar Feb 13 '12 19:02 ghost

Completely encapsulating SDL might even enable to ease writing a ScummVM engine that plays grail games at some point. But thats waaaaaayyyyy far in the future of cause ;)

Droggelbecher avatar Mar 08 '12 21:03 Droggelbecher