Pixel Graphs?

Sharky Forums


Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Pixel Graphs?

  1. #1
    Reef Shark Nephalim's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    463

    Question Pixel Graphs?

    Okay, as a disclaimer, I'm just getting into programming seriously... I messed around with Basic and some other derivitive Basics way long time ago, but have forgotten even the smallest thing about it. I took a C++ class in high school and again in college, but never got into it. However, now I do. I'm thinking seriously of getting into C++, ASP+ and such crap. Anyway...

    So like I said, I used to mess around with Basic and I remember programming a program which could do graphs on the screen. I think I would plot a point and use some kind of array to keep track of point positions and get/put new/old points as the data came in... worked with this little hardware dealio I had.

    So now I want to write a graph program in C++ (Win32 Console, can't figure out that MFC stuff yet... any helpful hints), but I can't find a way to plot points or lines. Can anyone point me in the right direction (for anything said here, really)? Sorry if I sound a little cluttered, I'm tired.

    ------------------
    ~ And that is my humble opinion.

    "Tink"
    1 GHz Tbird on A7V, 128MB RAM, Radeon 64MB DDR VIVO, SB Live! MP3+, 20.5GB HDD, Plexwriter 8/4/32, 3C905CTXM nic, Intellimouse Explorer
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Nephalim

    "Tink"
    1700+ XP on A7N8X, 768MB PC2700 DDRRAM, Samsung 19" 900IFT, Radeon 64MB DDR VIVO, SB Live! MP3+, 42.9GB IBM HDD, Plexwriter 8/4/32, 3C905CTXM NIC

    "Hermes"
    Dell Inspiron 8200, 1.7 GHz P4, 512MB DDRRAM, 30GB HDD, DVDROM, Geforce4 Go 64MB

  2. #2
    Reef Shark Nephalim's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    463

    Post

    There has to be a way to graph things using C++!!! I would think that if I could do it with QBASIC, I could do it with this?
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Nephalim

    "Tink"
    1700+ XP on A7N8X, 768MB PC2700 DDRRAM, Samsung 19" 900IFT, Radeon 64MB DDR VIVO, SB Live! MP3+, 42.9GB IBM HDD, Plexwriter 8/4/32, 3C905CTXM NIC

    "Hermes"
    Dell Inspiron 8200, 1.7 GHz P4, 512MB DDRRAM, 30GB HDD, DVDROM, Geforce4 Go 64MB

  3. #3
    Hammerhead Shark
    Join Date
    Sep 2000
    Location
    Luleå, Sweden
    Posts
    1,921

    Post

    You'll need to use a graphic API. I'd recommend OpenGL.

    ------------------
    Tweak you Radeon. Get Raid on Tweaker here
    Get UniTuner here

  4. #4
    Reef Shark Nephalim's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    463

    Post

    That gets pretty complicated, doesn't it? I was sort of looking for something simple, but if you think going straight into an API is the thing to do, than I guess I'll do it... you say OpenGL, would that be the best graphics API for a business setting?
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Nephalim

    "Tink"
    1700+ XP on A7N8X, 768MB PC2700 DDRRAM, Samsung 19" 900IFT, Radeon 64MB DDR VIVO, SB Live! MP3+, 42.9GB IBM HDD, Plexwriter 8/4/32, 3C905CTXM NIC

    "Hermes"
    Dell Inspiron 8200, 1.7 GHz P4, 512MB DDRRAM, 30GB HDD, DVDROM, Geforce4 Go 64MB

  5. #5
    Hammerhead Shark
    Join Date
    Sep 2000
    Location
    Luleå, Sweden
    Posts
    1,921

    Post

    OpenGL is pretty easy, and for only 2d stuff it gets even easier. There are plenty of resources on the net which can help you, and the forums over at www.opengl.org is very friendly and helpful so if you got problems, just post it over there.



    ------------------
    Tweak you Radeon. Get Raid on Tweaker here
    Get UniTuner here

  6. #6
    Catfish
    Join Date
    Nov 2000
    Location
    Melbourne
    Posts
    243

    Post

    Originally posted by Nephalim:
    That gets pretty complicated, doesn't it? I was sort of looking for something simple, but if you think going straight into an API is the thing to do, than I guess I'll do it... you say OpenGL, would that be the best graphics API for a business setting?
    I would say stick to the basic Windows API and it shouldn't be hard to do. Don't go learning Opengl or Direct3D because that requires some time to get the hang of it. Use MFC and it's classes for drawing.

  7. #7
    Hammerhead Shark
    Join Date
    Sep 2000
    Location
    Luleå, Sweden
    Posts
    1,921

    Post

    OpenGL is in many aspects just as easy or even easier to use for drawing than GDI, once you've initialized OpenGL (which isn't difficult at all) you only need to draw.

    glBegin(GL_LINES);
    glVertex2f(0,0);
    glVertex2f(100,100);
    glEnd();

    That's enough for drawing a line from (0,0) to (100,100).

    ------------------
    Tweak you Radeon. Get Raid on Tweaker here
    Get UniTuner here

  8. #8
    Catfish
    Join Date
    Nov 2000
    Location
    Melbourne
    Posts
    243

    Post

    Originally posted by Humus:
    OpenGL is in many aspects just as easy or even easier to use for drawing than GDI, once you've initialized OpenGL (which isn't difficult at all) you only need to draw.

    glBegin(GL_LINES);
    glVertex2f(0,0);
    glVertex2f(100,100);
    glEnd();

    That's enough for drawing a line from (0,0) to (100,100).

    True but as things get a little more complicated he'll have to learn about matrices. (if he wants to do animation)

  9. #9
    Hammerhead Shark
    Join Date
    Sep 2000
    Location
    Luleå, Sweden
    Posts
    1,921

    Post

    Yes, but if he starts with GDI and later on finds that he wants to do some more complicated stuff he'll just find that the GDI knowledge is useless and he need to look further. If he started with OpenGL he wont need to switch again to a new API. OpenGL is just as easy and usually even easier to use than GDI, even for simple 2d stuff. And it's hardware accelerated.


    ------------------
    Tweak you Radeon. Get Raid on Tweaker here
    Get UniTuner here

  10. #10
    Catfish
    Join Date
    Nov 2000
    Location
    Melbourne
    Posts
    243

    Post

    Originally posted by Humus:
    Yes, but if he starts with GDI and later on finds that he wants to do some more complicated stuff he'll just find that the GDI knowledge is useless and he need to look further. If he started with OpenGL he wont need to switch again to a new API. OpenGL is just as easy and usually even easier to use than GDI, even for simple 2d stuff. And it's hardware accelerated.


    Those are all good points but the problem with OpenGL it doesn't have a software renderer (which is fast enough to be useable). I'm guessing since this is for drawing graphs he'll need it to work on non-3d accelerated computers.

  11. #11
    Reef Shark Nephalim's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    463

    Post

    This is true, use on non-3D accelerated systems is a must. However, I have no idea how to use MFC (or where to start) and, although I could be wrong, I don't think MFC is supported for solely DOS driven systems(yes, they still exist)? I was wanting to code a graphing program without getting into Windows just yet. Can you suggest?

    Also, you've mentioned DirectX, OpenGL and GDI. What other mainstream graphics APIs are there?

    ------------------
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Me

    "Tink"
    1 GHz Tbird on A7V, 128MB PC133 RAM, Radeon 64MB DDR VIVO, SB Live! MP3+, 20.5GB HDD, Plexwriter 8/4/32, 3C905CTXM nic, Intellimouse Explorer
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Nephalim

    "Tink"
    1700+ XP on A7N8X, 768MB PC2700 DDRRAM, Samsung 19" 900IFT, Radeon 64MB DDR VIVO, SB Live! MP3+, 42.9GB IBM HDD, Plexwriter 8/4/32, 3C905CTXM NIC

    "Hermes"
    Dell Inspiron 8200, 1.7 GHz P4, 512MB DDRRAM, 30GB HDD, DVDROM, Geforce4 Go 64MB

  12. #12
    Hammerhead Shark
    Join Date
    Sep 2000
    Location
    Luleå, Sweden
    Posts
    1,921

    Post

    So, you're gonna work on DOS. That means you can forget about OpenGL, DirectX, GDI and MFC all together.
    DOS => No inbuilt graphic API. You need to do all by yourself. Coding graphics in DOS is way more low level, it's much harder and will require much more work to get much less done and end up with a much slower graphic engine. Anyway, i recommend this site: http://www.programmersheaven.com ... it has a lot of tutorial of all kinds, and many examples on DOS graphics etc.


    ------------------
    Tweak you Radeon. Get Raid on Tweaker here
    Get UniTuner here

  13. #13
    Reef Shark Nephalim's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    463

    Post

    That sucks! Might as well stick with old QBasic and hack it away with that. Damnit.

    Still, what are some of the other mainstream APIs?
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Nephalim

    "Tink"
    1700+ XP on A7N8X, 768MB PC2700 DDRRAM, Samsung 19" 900IFT, Radeon 64MB DDR VIVO, SB Live! MP3+, 42.9GB IBM HDD, Plexwriter 8/4/32, 3C905CTXM NIC

    "Hermes"
    Dell Inspiron 8200, 1.7 GHz P4, 512MB DDRRAM, 30GB HDD, DVDROM, Geforce4 Go 64MB

  14. #14
    Hammerhead Shark
    Join Date
    Sep 2000
    Location
    Luleå, Sweden
    Posts
    1,921

    Post

    There aren't many other mainstream API's. Glide is dying and obviously doesn't fit your needs. Mesa is a OpenGL close for Linux ...
    Yeah, that's it ...
    Anyway, I really think you should consider learing simple Win32 programming and OpenGL, it's easy and you won't regret it.


    ------------------
    Tweak you Radeon. Get Raid on Tweaker here
    Get UniTuner here

  15. #15
    Reef Shark Nephalim's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    463

    Post

    Much thanks for all your help-- I'll get right on it! (now, if only motivation was one of my strong points!! )

    ------------------
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Me

    "Tink"
    1 GHz Tbird on A7V, 128MB PC133 RAM, Radeon 64MB DDR VIVO, SB Live! MP3+, 20.5GB HDD, Plexwriter 8/4/32, 3C905CTXM nic, Intellimouse Explorer
    ~ And that is my humble opinion.

    When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. - Clarence Darrow

    The greatness of a woman’s power is measured in the size and amount of the balls she clutches in hand. -Nephalim

    "Tink"
    1700+ XP on A7N8X, 768MB PC2700 DDRRAM, Samsung 19" 900IFT, Radeon 64MB DDR VIVO, SB Live! MP3+, 42.9GB IBM HDD, Plexwriter 8/4/32, 3C905CTXM NIC

    "Hermes"
    Dell Inspiron 8200, 1.7 GHz P4, 512MB DDRRAM, 30GB HDD, DVDROM, Geforce4 Go 64MB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •