Changes between Version 8 and Version 9 of CodeConventions


Ignore:
Timestamp:
02/01/09 03:17:46 (4 years ago)
Author:
chris
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodeConventions

    v8 v9  
    11== Coordinate Systems == 
    22Epiar uses a pseudo-2D OpenGL context (source:/Graphics/video.cpp#L129) which does not obey Coordinate I signedness ((0,0) would be in the lower-left with increasing x going right and increasing y going up). However, we use SDL for many things, including image loading, and it appears that SDL stores images backwards, making it easiest (and the [http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06 NeHe tutorials do it] this following way too) to set up OpenGL to emulate an old style video buffer coordinate system, where (0,0) is in the top-left, x increases to the right and y increases down. If you call Image::Draw(x,y), it will draw the image so that the upper-left of the image is at (x,y). There is also a Image::!DrawCentered(x,y), in which the center of the image would then be located at (x,y). 
     3 
     4There's no speed disadvantage to this, you just have to keep it in my when using coordinates at all, especially when you're writing an algorithm that uses trigonometry.