Jump to content
  • Advertisement
  • entries
    383
  • comments
    1075
  • views
    353328

Update on the update

Sign in to follow this  
Trapper Zoid

68 views

Random Thought for the Day
If there's one programming problem I really hate, it's linker errors from libraries. I hate fiddling around with my project settings.


Quick update from last entry: the graphics system does seem to be working. I only got a basic test up and running this morning, but I could get my "DrawSprite" function to draw the star from the second sample picture in the centre of the screen. There's a few slight hiccups in the system to figure out; I'll need a bunch of drawing functions for different occasions, and there's a problem with the transparency causing artifacts on the edges of the sprites, but those should be solvable with trial and error and more reading up on OpenGL.

The only problems the system had was an annoying SDL error, caused by me linking the libraries in the wrong order (that took me a while to figure out; it seems so stupid that makes a difference), and me forgetting that OpenGL texture coordinates like to use a (0,0)-(1,1) floating point scale instead of pixel dimensions. There probably is an easy way to use pixel coordinates directly, but it was just easier to modify my XML writing function to output a floating point fraction instead.

I've also decided to use a coordinate system based on the screen width to specify sprite positions. The top-left corner of the screen is (-1.0,0.75), bottom-right (1.0,-0.75). I figured I might as well use a cartesian based system with positive y coords at the top of the screen, and since I wanted something resolution independant using the screen width made sense. For Pierre and the Fish I used the screen height instead, making the top-left (-1.3333, 1.0), but using the other method makes nicer fractions. The only snag at the moment is the assumption of a 4:3 width-to-height ratio, which I'm not sure of an easy way around for a 2D engine.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!