Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3952642
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:52:45+00:00 2026-05-20T01:52:45+00:00

I have been learning OpenGL and SDL lately and I’ve become rather confused about

  • 0

I have been learning OpenGL and SDL lately and I’ve become rather confused about the coordinate system in SDL and glOrtho. I’ve read a few tutorials about the SDL’s coordinate system that says the coordinates go from (0,0) to (w, h) which does not make sense to me. If if the width goes from 0 to w then that means there is one extra pixel.

Also, with the OpenGL glOrtho function, I’ve seen all examples where the coordinate system is changed to one that’s similar to SDL take the following form:

glOrtho (0, screenWidth, screenHeight, 0, 1, -1);

However doesn’t it make more sense to make it this instead?:

glOrtho (0, screenWidth-1, screenHeight-1, 0, 1, -1);

Hope you guys can clarify this for me, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:52:45+00:00Added an answer on May 20, 2026 at 1:52 am

    Kind of the same confusion like the beginning of the new millenia. I’ll try to explain:

    Take some piece of grid-ruled paper and mark some grid crossing as your origin, i.e. 0,0 coordinate. Measure a width of, say 9 grid units in one direction, mark it. Now count the number of cells you measured. Let me illustrate:

    0 1 2 3 4 5 6 7 8 9 <- grid lines; coordinate range
    | | | | | | | | | |
    | | | | | | | | | |
    | | | | | | | | | |
    |0|1|2|3|4|5|6|7|8| <- cell index/offset
    

    So you’ve got a grid of width 9, but there are only 9-1=8 cells (e.g. pixels) within. The ranges you give to glOrtho are the limits of the range.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been learning opengl for about 4-5 months now. I am ready to
I have been learning about IE's rather ridiculous-looking requirements for shadows, gradients, etc., and
I have been learning about Delegation and Data Sources for iOS programming and need
I have been learning Ruby lately, and I want to upload a test web
I have been learning about various functional languages for some time now including Haskell,
I have been learning about TDD (using JUnit) and I have a doubt about
I'm 14 and have been learning java for about 4/5 months. I'm coding a
I have been playing around with the min3D libraries a bit lately learning how
I have been learning about indexes in Oracle SQL, and I wanted to conduct
I have been learning about collision in phisics programming , and i have one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.