Simple graphics and mouse

This is a discussion on Simple graphics and mouse within the C++ Programming forums, part of the General Programming Boards category; I am working on a blackjack game right now and I want the user to be able to use a ...

  1. #1
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561

    Simple graphics and mouse

    I am working on a blackjack game right now and I want the user to be able to use a mouse and have buttons, and it would be nice if I could load simple bitmaps or jpegs onto the screen. I am only a beginning programmer, so if it is too messy, forget it. Is there a simple way to get this done?

  2. #2
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561
    Oh and btw I am using Bloodshed Dev C++.

  3. #3
    31173 h4x0r gnu-ehacks's Avatar
    Join Date
    Nov 2001
    Posts
    556
    Look into Win32 API and GDI.
    What will people say if they hear that I'm a Jesus freak?
    What will people do if they find that it's true?
    I don't really care if they label me a Jesus freak, there is no disguising the truth!

    Jesus Freak, D.C. Talk

    -gnu-ehacks

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    Or the wonderful Allegro library. Home page here. Graphical installer for Dev-C++ here.
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

  5. #5
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    As you are a beginner you would learn a lot faster if you did it as a text game and left the bitmap stuff until you are more confident with c++.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  6. #6
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561
    Well I finished the blackjack game last night, of course it is text, and it has a dealer with AI (if you can call it AI, it's just stand on 16, hit on everything below), and it deals with the ace being 1 or 11. I think im confident enough to make it look pretty now.

  7. #7
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Then buy the excellent programming windows 5th edition by charles petzold and start reading. This is the best book to start windows programming with and he barely touches upon bitmaps until about chapter 10. Programming for windows needs a totally different style to anything that you are used too. You should get that book if you are serious about learning windows programming.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  8. #8
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561
    I looked at a preview of the book online and it says the topics are covered in c... excuse me if this is a dumb question but is there any syntax difference between c and c++?

  9. #9
    Unregistered
    Guest
    yes some big differences some small.

    The good news is once you know both its very easy to convert one to the other.

    I use c++ mostly which I learned before I learned c, I had to learn c for networking tutorials which i had in c.

    Once you know C++ anything you read in c wont be too difficult for you top understand.

  10. #10
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    I am 99% sure that the c code used in petzold will also compile as valid c++ . For a more OOP look at windows programming you will need something like :-
    Programming windows with mfc by jeff prosise.

    This is the "sister-book" of the petzold and i recommend you get them both but because in mfc you often have to fall back on the pure win32 api to get things done so that is why i suggested petzold first. You can go straight into mfc but you will almost certainly struggle after a while. Get petzold! c code is readable and understanable when you get used to hungarian notation.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  11. #11
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Petzold used C because Win32 is a C library of functions. Another choice might be Pezolds new book which uses C# to build Windows Forms programs that are part of the .NET Base Class Library. Petzold claims that C# is his favorite language.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Drawing a user's mouse movements
    By John_L in forum C# Programming
    Replies: 0
    Last Post: 11-07-2007, 04:16 PM
  2. Replies: 3
    Last Post: 05-13-2007, 08:55 AM
  3. using gotoxy() in graphics mode
    By sureshkumarct in forum C Programming
    Replies: 1
    Last Post: 01-08-2007, 12:18 PM
  4. Handling mouse in graphics mode in Turbo C/DOS
    By sureshkumarct in forum C Programming
    Replies: 2
    Last Post: 12-24-2006, 08:36 AM
  5. Getting started with 2d graphics.
    By NickB in forum Windows Programming
    Replies: 3
    Last Post: 08-22-2001, 11:40 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21