Thread: Graphcis

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    132

    Graphcis

    I am just wondering what i need to be able to make 2D stuff on C\C++ ? like 2D cards.. etc...

    i know about OpenGL but thats for 3D graphics, am i right?

    i just want a 2D thing.

    please help

  2. #2
    The Richness... Richie T's Avatar
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    469
    I think most (all?) graphics libraries have 2-d support - OpenGL
    does. It'd be 3-d that a library would be less likely to handle, but
    then it'd be really old, since 3-d graphics have been around for
    ages.
    No No's:
    fflush (stdin); gets (); void main ();


    Goodies:
    Example of fgets (); The FAQ, C/C++ Reference


    My Gear:
    OS - Windows XP
    IDE - MS Visual C++ 2008 Express Edition


    ASCII stupid question, get a stupid ANSI

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    132
    ok, well i use Dev C++, how do i use openGL ? do i need to download any extras to access it?

    and also, i have Visual Studio 2005 Pro Full Edition right, but i dont get how to use it, like it says PROJECT -> setting -> link and then link opengl, glaux and glu, but i cannot find the place where i enter this. its not in setting, its weird.

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    903
    I don't know about VS2005 but in VS2003 you could use the #pragma pre-processor command like this:

    Code:
    #pragma comment(lib, "lib_name.lib")
    Where obviously you replace lib_name by the actual name of the library. Give it a try.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    I suppose this is where we find out the OP is using TurboC or something.....
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    May 2006
    Posts
    34
    This thread should probably be in the Game Programming board, but anyway...

    I wouldn't really recomend OpenGL if you're just starting out. While you certainly can do 2D graphics with OpenGL, you pretty much have to do it in terms of 3D. You set the camera to an othogonal projection (i.e. no perspective) and then set up a quad primitive and texture map it. It takes quite a bit of work to get it all working, and you'll need to know a bit about 3d math, etc. A bit too complicated for someone just starting. On the other hand, it's the best way to go...just about any game that does 2D graphics these days will use this method.

    I would recomend using the SDL library. It's easy to set up, and there's plenty of tutorials on getting started. Underneith the hood, it uses OpenGL and DirectDraw (on Windows), so you can use either of them without much hassle....no need to know how to create a window or how to do the complicated initialization. There's lots of addon libraries too, for things like adding networking capabilities. Here's the URL:

    http://www.libsdl.org/index.php

Popular pages Recent additions subscribe to a feed