Thread: graphics programming in windows - pls help

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

    graphics programming in windows - pls help

    look at the follwing code .

    Code:
    #include <graphics.h>
    
    main ()
    {
           int gd=DETECT,gm;
           
          initgraph(&gd,&gm,"c:\\tc\\bgi"); // remember there is no bgi       
                                                              // files in borland c++ 5.5
          
          setcolor ( RED);
          line ( 25,25,100,25);
          
          closegraph();
          restorecrtmode();
    }

    can any body suggest how to compile this code in windows based compilers such as borland c++ builder, dev-c++ etc .

    thanks.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > can any body suggest how to compile this code in windows based compilers such as borland
    > c++ builder, dev-c++ etc .
    yeah, forget it.
    That's old 16-bit, low resolution blah blah blah code.

    In dev-c++, find the devpack which downloads libsdl
    Then goto http://www.libsdl.org/index.php and read the tutorials, download the samples and learn a graphics API for this millenium.
    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.

  3. #3
    Registered User
    Join Date
    May 2006
    Location
    Da World
    Posts
    6
    For advanced graphics, go for OpenGL..to use opengl in dev-cpp, here is a tutorial ZeusCMD OpenGL Tutorial..

  4. #4
    Registered User
    Join Date
    Apr 2006
    Posts
    12

    thanks

    thanks g33k and salem for your help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  3. Graphics Programming :: Approach and Books
    By kuphryn in forum Windows Programming
    Replies: 4
    Last Post: 05-11-2004, 08:33 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. Graphics in a window in windows
    By Korn1699 in forum C++ Programming
    Replies: 2
    Last Post: 06-16-2002, 12:59 AM