I'll leave that for the OP.
Right now I'm more interested on making PDCurses working for me
I'll leave that for the OP.
Right now I'm more interested on making PDCurses working for me
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
I found this on a web site, would this be the code that i could use?
Code:setcolor(YELLOW); settextstyle(DEFAULT_FONT, HORIZ_DIR, 2); // 2 = size outtextxy(20, 320, "Press any key ... "); getch();Code:// do some graphics using the WinBgi package from: // http://csci.biola.edu/csci105/using_winbgi.html // // for Dev-C++ you need to fix graphics2.h and WinBgi2.cpp // do change unsigned int getpixel() to int getpixel() // // have WinBgi2.cpp in the working folder and add to project // have graphics2.h in the working folder // link with libgdi32.a // this Dev-C++ project is a Console Application #include <cstdio> #include <cmath> #include "graphics2.h" using namespace std; int main() { int GraphDriver = 0, GraphMode = 0; // create graph window frame initgraph(&GraphDriver, &GraphMode, "", 640, 480); // first draw two ellipses and a line ... setcolor(CYAN); setlinestyle(SOLID_LINE, 0, 2); // 2 pixels wide //** ellipse(int x,int y,int sa,int ea,int rx,int ry) //** center = x, y //** sa = start of arc (0 to 360 degrees) //** ea = end of arc //** rx = length of horizontal axis (radius) //** ry = length of vertical axis (radius) ellipse(320, 150, 0, 360, 150, 20); setcolor(LIGHTGREEN); setlinestyle(SOLID_LINE, 0, 3); // 3 pixels wide ellipse(320, 150, 0, 360, 40, 90); setcolor(LIGHTRED); setlinestyle(SOLID_LINE, 0, 2); // line(int x1, int y1, int x2, int y2) line(20, 300, 600, 300); setcolor(YELLOW); settextstyle(DEFAULT_FONT, HORIZ_DIR, 2); outtextxy(20, 320, "Press any key ... "); getch(); // wait // now draw some fancy lines ... int x, y; int spokes = 6; // triangle = 3, more complex > 3 double radians; setcolor(GREEN); radians = 360 / (spokes * 57.29578); for (x = 1; x <= spokes; x++) { for (y = x; y <= spokes; y++) { line((int)(sin(y * radians) * 225 + 320),(int)(cos(y * radians) * 145 + 150), (int)(sin(x * radians) * 225 + 320),(int)(cos(x * radians) * 145 + 150)); } } outtextxy(20,320,"Press any key ... "); getch(); // wait closegraph(); return 0; }
Does it have graphics2.h too? (I'm interested Thanks for posting!)
yes it does
Em, what site did you get it from (we need graphics2.h to work it ... ), or paste the header there too
Code:// do some graphics using the WinBgi package from: // http://csci.biola.edu/csci105/using_winbgi.html // // for Dev-C++ you need to fix graphics2.h and WinBgi2.cpp // do change unsigned int getpixel() to int getpixel() // // have WinBgi2.cpp in the working folder and add to project // have graphics2.h in the working folder // link with libgdi32.a // this Dev-C++ project is a Console Application
Last edited by DarkDarkDark; 08-02-2006 at 04:22 PM.
<--------------------------------------
Nice arrow! Sometimes I need it for not seeing the obvious. It would have been better had you bolded it though I may have missed it again!
I cant seem to get it to work, i keep getting errors like
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Test\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Test\Makefile.win" all
g++.exe main.o -o "Project2.exe" -L"C:/Dev-Cpp/lib"
main.o(.text+0x61):main.cpp: undefined reference to `initgraph'
main.o(.text+0x6d):main.cpp: undefined reference to `setcolor'
main.o(.text+0x89):main.cpp: undefined reference to `setlinestyle'
main.o(.text+0xbd):main.cpp: undefined reference to `ellipse'
main.o(.text+0xc9):main.cpp: undefined reference to `setcolor'
main.o(.text+0xe5):main.cpp: undefined reference to `setlinestyle'
main.o(.text+0x119):main.cpp: undefined reference to `ellipse'
main.o(.text+0x125):main.cpp: undefined reference to `setcolor'
main.o(.text+0x141):main.cpp: undefined reference to `setlinestyle'
main.o(.text+0x165):main.cpp: undefined reference to `line'
main.o(.text+0x171):main.cpp: undefined reference to `setcolor'
main.o(.text+0x18d):main.cpp: undefined reference to `settextstyle'
main.o(.text+0x1a9):main.cpp: undefined reference to `outtextxy'
main.o(.text+0x1c1):main.cpp: undefined reference to `setcolor'
main.o(.text+0x2f4):main.cpp: undefined reference to `line'
main.o(.text+0x324):main.cpp: undefined reference to `outtextxy'
main.o(.text+0x32e):main.cpp: undefined reference to `closegraph'
collect2: ld returned 1 exit status
make.exe: *** [Project2.exe] Error 1
Execution terminated
Might be the cause of the problem...// link with libgdi32.a
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
You need to link with the lib file provided.
Check the documentation. It will probably be called something like libbgi.a. It should be in your compiler's lib directory. The linker should have this library included.
Edit: Richie got me
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Okay then, what i should have said was, how do you link.
whats your compiler?
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Dev-C++ 4.9.9.2
Ah... then you don't want to use that one. You have http://www.codecutter.net/tools/winbgim/ that was built specificaly for MingW.
follow the instructions in the readme file
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.