Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. c++ graphics

c++ graphics

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++cssgraphicsgame-dev
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    virtualspy
    wrote on last edited by
    #1

    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..

    R D C J 4 Replies Last reply
    0
    • V virtualspy

      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..

      R Offline
      R Offline
      Ryan Binns
      wrote on last edited by
      #2

      :confused: What language/library are you using? I don't recognise outtext() or outtextxy(). 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"

      J 1 Reply Last reply
      0
      • V virtualspy

        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..

        D Offline
        D Offline
        dog_spawn
        wrote on last edited by
        #3

        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[^]

        R M 2 Replies Last reply
        0
        • D dog_spawn

          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[^]

          R Offline
          R Offline
          Ryan Binns
          wrote on last edited by
          #4

          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"

          1 Reply Last reply
          0
          • D dog_spawn

            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[^]

            M Offline
            M Offline
            Mike Nordell
            wrote on last edited by
            #5

            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).

            1 Reply Last reply
            0
            • V virtualspy

              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..

              C Offline
              C Offline
              conio
              wrote on last edited by
              #6

              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:

              V 1 Reply Last reply
              0
              • R Ryan Binns

                :confused: What language/library are you using? I don't recognise outtext() or outtextxy(). 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"

                J Offline
                J Offline
                John M Drescher
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • V virtualspy

                  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..

                  J Offline
                  J Offline
                  John M Drescher
                  wrote on last edited by
                  #8

                  Convert the number to a string... John

                  1 Reply Last reply
                  0
                  • C conio

                    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:

                    V Offline
                    V Offline
                    virtualspy
                    wrote on last edited by
                    #9

                    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..:);)

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups