sol

06-19-2007, 08:51 PM

Bonjour.

The program I am writing is completely 2D. All

the math and logic assumes a coordinate system

where x = 0 is the left and y = 0 is the top of

the window.

The problem:

glViewport, which I expect to use a lot, in

various parts of the code, expects the y value to

be the bottom of the window. Sooner or later,

I'm bound to forget to adjust y and end up with

a blank screen or other hard to track down visual

error.

Essentially I'm looking for something like this:

void cam_viewport(int x, int y, int w, int h)

{

glViewport(x, adjust_y(y), w, h);

}Any ideas how this can be implemented? I'm sure

the solution is simple but I can't quite seem to

get it.

The program I am writing is completely 2D. All

the math and logic assumes a coordinate system

where x = 0 is the left and y = 0 is the top of

the window.

The problem:

glViewport, which I expect to use a lot, in

various parts of the code, expects the y value to

be the bottom of the window. Sooner or later,

I'm bound to forget to adjust y and end up with

a blank screen or other hard to track down visual

error.

Essentially I'm looking for something like this:

void cam_viewport(int x, int y, int w, int h)

{

glViewport(x, adjust_y(y), w, h);

}Any ideas how this can be implemented? I'm sure

the solution is simple but I can't quite seem to

get it.