Noobish question about graphics

This is a discussion on Noobish question about graphics within the Game Programming forums, part of the General Programming Boards category; I know its a really noobish question, but I really need to know. Is it necessary to use a library ...

  1. #1
    Registered User
    Join Date
    Aug 2006
    Location
    Israel
    Posts
    33

    Noobish question about graphics

    I know its a really noobish question, but I really need to know. Is it necessary to use a library such as OpenGL, DirectX or STL to make a game with graphics? Can't you do it with C (or C++) only?
    Also, how does this all graphics libraries work, in general?

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,069
    Quote Originally Posted by ThWolf
    I know its a really noobish question, but I really need to know. Is it necessary to use a library such as OpenGL, DirectX or STL to make a game with graphics? Can't you do it with C (or C++) only?
    You should probably ask yourself what language OpenGL and DirectX are written in and that should answer your second question. I don't know where you got the idea that STL has anything to do with game graphics, it's merely a library of useful functions to aid you in any kind of C++ program.

    Quote Originally Posted by ThWolf
    Also, how does this all graphics libraries work, in general?
    It's just math. I creates a theoretical 3D area on your monitor, waits for the programmer to say where to place points, does the math to find exactly where that point would appear from the origin and places it at that pixel. Lines are simply two points being connected, polygons are three or more... Without getting into the 3D of it, try and think about Algebra I in high school, or elementary school, or wherever you may have taken it. You get a function, you plot the points on the plane, you connect the dots. That's generally what it does.
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    196
    he might have meant sdl

  4. #4
    Registered User
    Join Date
    Aug 2006
    Location
    Israel
    Posts
    33
    I was mistaken lol. I meant SDL.
    Thank you, anyway. I basically want to create a simple 2d game, though I know I have a lot to learn before I do that. Which one of the libraries is good for that, in your opinion?
    Last edited by ThWolf; 09-01-2006 at 09:44 AM.

  5. #5
    Software engineer
    Join Date
    Aug 2005
    Location
    Oregon
    Posts
    283
    It really depends on each project. I have been recommending OpenGL more and more over the years, especially today. The Khronos Group (http://www.khronos.org) has taken over and have been showing some amazing stuff. It has more packages to offer than DirectX does at the moment (it use to officially just be "graphics"). It is portable across machines unlike DirectX, and you can get by without learning the Win32 API using OpenGL with GLUT (manages the window for you and more). If you can afford it, get the OpenGL SuperBible since it reaches beginners using GLUT as well.

    DirectX and OpenGL debates are well known, so I'll just end it before it begins: OpenGL can teach you how to become a general graphics programmer while Direct3D (3d component of DirectX) teahces you how to be a Microsoft graphics programmer. When it comes to a career, can you live with being stuck to one vendor, or do you want to stay as general as possible? But at the end of the day, both are known to get the job done.

  6. #6
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    Well put.

    I'd just like to add that you don't necessarily need to know OpenGL or Direct3D. There's always the option of writing your own graphics library in software, should you decide you want to know about what goes on in those functions OGL and D3D provide you.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need help to compile this code...
    By wise_ron in forum C Programming
    Replies: 17
    Last Post: 05-07-2006, 12:22 PM
  2. A question about the old BGI graphics libary
    By p3t3r1 in forum C Programming
    Replies: 0
    Last Post: 04-30-2006, 11:19 AM
  3. noobish question regarding using "or"
    By n3v in forum C++ Programming
    Replies: 2
    Last Post: 03-22-2006, 02:44 PM
  4. graphics card question
    By dP munky in forum Tech Board
    Replies: 4
    Last Post: 01-09-2003, 08:05 PM
  5. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 02:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21