Questions tagged [bgi]

Borland graphics interface (graphics.h) is a legacy library for 2D graphics similar to nowadays GDI.

Borland graphics interface (graphics.h)

  • is an old legacy library for 2D graphics similar to nowadays
  • was widely used with Borland IDE's like Turbo Pascal or Turbo C++
  • is still used in some schools
392 questions
2
votes
2 answers

Making DEV++ compatible with code/headers from Turbo C++

I work in a factory where 80% of our equipment uses an MS-DOS interface. None of our engineers have experience in c/c++ programming, and it was requested we add some features to the machines interface. Our automation group has abandoned the MS-DOS…
tsmetana
  • 25
  • 3
2
votes
1 answer

the following code always stuck and the window hangs

#include #include #include #include #include main() { int gd = DETECT, gm, area, temp1, temp2, left = 25, top = 75; void far *p; initgraph(&gd,&gm,"C:\\TurboC3\\BGI"); …
2
votes
3 answers

How to draw picture in GUI window using it's pixel values in c?

I want to read bmp image and draw the pixel values in GUI window but it is not giving me the correct result,the picture it is showing is completely different then the original image I don't know where I am going wrong. any help? int main() { char…
user3370649
  • 57
  • 1
  • 8
2
votes
3 answers

Undefined references when using graphics.h?

I am trying to use graphics.h in dev C++ 5.7.1. I already searched the internet for the available options. I downloaded the graphics.h library in the include folder and chose the following in the parameters…
Avni Singh
  • 21
  • 1
  • 1
  • 3
2
votes
2 answers

How do I clean input buffer before using getch()?

So, I am using GetAsyncKeyState() to see when some key is pressed. But, after using it I need to use getch(). But it seems that getch() gets whatever GetAsyncKeyState() got before again. That is the version of my simplified code: #include…
user3496846
  • 1,627
  • 3
  • 16
  • 28
2
votes
0 answers

how do i include C/ C++ graphics.h when im using the code for node.js

I have to work with the C & C++ API's using node.js.. the problem is my C code includes graphics.h file which is not found in node.js.. i don't have any alternate for graphics.h.
ss56
  • 285
  • 1
  • 9
2
votes
3 answers

Why following C code compiles without an error?

My code is as follows: void main() { int gdriver=DETECT, gmode; initgraph(&gdriver, &gmode, " "); getch(); closegraph(); } Though the value of graphics mode(gmode) has not been initialized, its address has been passed into the…
krupal
  • 854
  • 2
  • 11
  • 17
2
votes
2 answers

Can gcc compile graphics.h or will graphic.h only compile with the borlan turbo c compiler

I see everyone recommends just using openGL and some others but I don't wanna. I just want to know if graphic.h will only compile in turbo c and not with gcc, Thanks
user2910577
  • 43
  • 1
  • 2
  • 6
2
votes
1 answer

Can't draw objects in C++ graphics

In this code i want to show a circle, and a bar with black border color on a white background. But while i compile this code in TurboC++, this shows only a white background. can not understand why objects are not displaying.. what i'm missing?Here's…
Jessica Lingmn
  • 1,162
  • 3
  • 10
  • 15
2
votes
0 answers

C: Creating multiple instances of an enemy.?

struct animate { int drawable; int animationFrames; char *frames[TOTAL_FRAMES+1]; int charWidth; int charHeight; int xCoord; int yCoord; int xMove; int yMove; int currentFrame; }; struct animate reaper[] = { { 1, 3, { …
Tyler Dahle
  • 77
  • 1
  • 8
2
votes
1 answer

Draw ellipse into rectangle in C

The following C code will draw a rectangle. I know how to draw the ellipse, but how can i draw an ellipse into this rectangle? #include #include main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\TC\\BGI"); …
TPSstar
  • 121
  • 1
  • 13
1
vote
1 answer

Drawing circles on a diagonal line in C++

I've been working on this for about an hour now and I can't figure out what I'm doing wrong. This is the problem statement for the problem: Draw a series of circles along one diagonal of a window. The circles should be different colors and each…
Sean K
  • 147
  • 2
  • 12
1
vote
1 answer

graphics for MingW

I am using Windows 7 and MingW for compiling c programs that I write.. I wish to learn how to draw lines, arc, circles (graphics) in C - programming. the book I am referring to uses graphics.h and graphics.lib of turboC. But I have mingW. how do I…
KawaiKx
  • 9,558
  • 19
  • 72
  • 111
1
vote
1 answer

Graphical intersection of lines in C

I have a homework. The homework is: There are 3 lines, theirs end with squares. Firstly The program has to view a circle is the lines are cut each other. (In other way: Take the intersection of the 3 lines). Secondly, the program has to change the…
Dabagab
  • 2,497
  • 4
  • 26
  • 31
1
vote
2 answers

Multiple Definition errors in c++

Here's some code that I wrote in DevCpp (windows), now I'm trying to get it to run in linux without much success. Here is the source code screen.h #ifndef SCREEN_H #define SCREEN_H #include class Screen { private: …
nikhil
  • 8,925
  • 21
  • 62
  • 102