0 Members and 3 Guests are viewing this topic.
I really like the way you've handled that, it makes it much easier to use the same screen buffer to put stats and such on the screen as well as the rendered scene. If you want to I could try to help you optimize the code to make it faster. Also are you going to keep the variable viewing screen size in the finished program? If you are, the client code could adjust the viewing area to meet it's own processing needs. That way, games with more complicated AI and such would be able to make up for the processing time for that by decreasing the screen size. It would make your engine extremely flexible.
render() takes the width and height of the screen as two of its parameters.
typedef struct{ int screen_width, int screen_height, //pointer to sprite array, however that's defined// // same for texture array//int screen_position_x,int screen_position_y// etc//}render_structure;render_structure rend_struct;render(rend_struct);
Are you also able to set where on the screen buffer the viewing area is rendered?