Graphics problems

This is a discussion on Graphics problems within the C++ Programming forums, part of the General Programming Boards category; hi all i don't know if this would be teh correct place to post but i dont know anywhere else... ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    7

    Graphics problems

    hi all
    i don't know if this would be teh correct place to post but i dont know anywhere else...
    here goes.

    I'm having trouble trying to output a variable using graphics window BGI, i'm using Borland C++ builder....
    Code:
    #include <iostream>
    #include <conio.h> 
    #include "graphics2.h"
    #include <windows.h>
    
    using namespace std;
    
    int main(void)
    {    
      int GraphDriver = 0;
      int GraphMode = 0;
      GraphDriver = 0;
      GraphMode = 0; 
      int timer;
      timer = 5;    
      initgraph(&GraphDriver, &GraphMode, "", 640, 480);
    
      do
      {
        Sleep (999);
        outtextxy(10,200, timer);/*<<the timer variable is what i need to output but can't*/
        timer = (timer - 1);
      }while (timer >0);
    return = 0;
    }
    Basically its a 5 second countdown/timer , just can't get teh variable to output on screen.
    I'd appreciate any help

    Thanks.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    I'm not familiar with this borland graphics library that your using but maybe outtextxy expects a charactor string and not an int.
    you can use the itoa() function to create a charactor string from an int.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle Graphics, how does it work?
    By freddyvorhees in forum C++ Programming
    Replies: 15
    Last Post: 08-28-2009, 10:57 AM
  2. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 03:59 AM
  3. C Pointers Problems
    By mhelal in forum C Programming
    Replies: 8
    Last Post: 01-10-2007, 06:35 AM
  4. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM
  5. Im a Newbie with a graphics design problem for my simple game
    By Robert_Ingleby in forum C++ Programming
    Replies: 1
    Last Post: 11-23-2001, 06:41 PM

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