Hello everyone,
On similar drawing api’s i have a function which i use to implement camera movement. For instance, on Java2D i can use [1] and javascript i can use [2], they are quite similar (not complete equal, but similar)
But on SDL i had no success on find something similar to this.
I’ve solved my issue by using a second buffer to draw the background buffer and the sprites and then draw that on the screen. But find a solution able to make the 3 research codebases more similar to each other would be nice.
For context, please see the following Cameras and Scenarios (see links, not going to pollute the post.)
SDL version
http://code.google.com/p/sombriks-hq/source/browse/trunk/yarpg-cpp/Camera.cc?r=360
http://code.google.com/p/sombriks-hq/source/browse/trunk/yarpg-cpp/Scenario.cc?r=360#65
Java2D version
http://code.google.com/p/sombriks-hq/source/browse/trunk/yarpg-java/src/yarpg/Camera.java?r=360
http://code.google.com/p/sombriks-hq/source/browse/trunk/yarpg-java/src/yarpg/Scenario.java?r=360#67
Canvas/Javascript version
http://code.google.com/p/sombriks-hq/source/browse/trunk/yarpg-js/yarpg-js/Camera.js?r=360
http://code.google.com/p/sombriks-hq/source/browse/trunk/yarpg-js/yarpg-js/Scenario.js?r=360#53
[1] http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Graphics.html#translate(int,%20int)
[2] https://developer.mozilla.org/en/Canvas_tutorial/Transformations#Translating
Thanks in advance.