c++ graphics
-
i'm creating a game that should print numbers in a grid.the problem is i can use the library functions outtext(),outtextxy() for print only strings but not numbers which need to be interchanged during various steps of the game.to be specific,i got to place the cursor at some central position on the screen and print a number.can anyone help me out??:laugh: thanx in advance..
-
i'm creating a game that should print numbers in a grid.the problem is i can use the library functions outtext(),outtextxy() for print only strings but not numbers which need to be interchanged during various steps of the game.to be specific,i got to place the cursor at some central position on the screen and print a number.can anyone help me out??:laugh: thanx in advance..
:confused: What language/library are you using? I don't recognise
outtext()
orouttextxy()
. The only place I know them from is the old Borland Turbo Pascal/C BGI drivers, but I haven't used them for years.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
i'm creating a game that should print numbers in a grid.the problem is i can use the library functions outtext(),outtextxy() for print only strings but not numbers which need to be interchanged during various steps of the game.to be specific,i got to place the cursor at some central position on the screen and print a number.can anyone help me out??:laugh: thanx in advance..
For fullscreen games, use OpenGL or DirectX. I found OpenGL was easier to learn. They both deal with 2d and 3d graphics. I can't help you for non fullscreen games like minesweeper though... perhaps learn GDI+ or something? dog_spawn http://hatekill.yojutsu.com[^]
-
For fullscreen games, use OpenGL or DirectX. I found OpenGL was easier to learn. They both deal with 2d and 3d graphics. I can't help you for non fullscreen games like minesweeper though... perhaps learn GDI+ or something? dog_spawn http://hatekill.yojutsu.com[^]
dog_spawn wrote: perhaps learn GDI+ or something? GDI+ is nice and powerful, but much slower than GDI, although for a simple game like minesweeper, I'd hardly say performance was an issue ;)
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
For fullscreen games, use OpenGL or DirectX. I found OpenGL was easier to learn. They both deal with 2d and 3d graphics. I can't help you for non fullscreen games like minesweeper though... perhaps learn GDI+ or something? dog_spawn http://hatekill.yojutsu.com[^]
dog_spawn wrote: They both deal with 2d and 3d graphics. Uhhh, in all honesty OpenGL is a 3D API. Sure, you can (with some effort) use its 3D functionality (slapping quads) in conjunction with awkward texture-replacing primitives to implement a 2D API, but then you also can use a hammer to pound on the keyboard. :-) DirectDraw/DirectX deals with 2D gfx in a way more direct, to-the-point and familiar way than any 3D API ever could, or even should, do. If the game gfx-speed isn't time critical, I'd rather suggest GDI than DirectDraw (since the latter is inherently way more complex and error-prone). Creating a DIBSection and blitting around within only the gfx cards memory can get you quite reasonable speeds also (way faster than screen refresh rate).
-
i'm creating a game that should print numbers in a grid.the problem is i can use the library functions outtext(),outtextxy() for print only strings but not numbers which need to be interchanged during various steps of the game.to be specific,i got to place the cursor at some central position on the screen and print a number.can anyone help me out??:laugh: thanx in advance..
i think that you are using the good old turbo c++. try the funtion itoa(int val,char* buffer,int base) to convert the integer to a string and then use the string. for floats you can use ftoa(float val,char* buffer,int base). to get the int ir the float back use atoi or atof etc. The Debugger:omg:
-
:confused: What language/library are you using? I don't recognise
outtext()
orouttextxy()
. The only place I know them from is the old Borland Turbo Pascal/C BGI drivers, but I haven't used them for years.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
Ryan Binns wrote: The only place I know them from is the old Borland Turbo Pascal/C BGI drivers, but I haven't used them for years. Same here... John
-
i'm creating a game that should print numbers in a grid.the problem is i can use the library functions outtext(),outtextxy() for print only strings but not numbers which need to be interchanged during various steps of the game.to be specific,i got to place the cursor at some central position on the screen and print a number.can anyone help me out??:laugh: thanx in advance..
Convert the number to a string... John
-
i think that you are using the good old turbo c++. try the funtion itoa(int val,char* buffer,int base) to convert the integer to a string and then use the string. for floats you can use ftoa(float val,char* buffer,int base). to get the int ir the float back use atoi or atof etc. The Debugger:omg:
hey debugger thanx man..i wanted exactly that!!these guys were talking about openGL and all that stuff.hey but i'm just a tyro..thanx once again.i'll try that out..:);)