Thread: Which platform to use for 2D-games?

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    16

    Which platform to use for 2D-games?

    I am a veteran C/C++ programmer, but I think we all know that it's not really that great for programming graphical stuff.

    So, what I am looking for is the best possible language (and/or toolkit) to develope a game client that can support a dynamic 2D map, MySQL connections, and other HTML-like features such as a select box.

    Any suggestions?

  2. #2
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    Quote Originally Posted by Siphon
    I am a veteran C/C++ programmer, but I think we all know that it's not really that great for programming graphical stuff.
    Ehh, actually I think what we all know is that it *is* great for graphics programming.

    Although then you go on to ask about SQL and select boxes...if you're looking for a GUI/Windowing library, you can grab wxWidgets or Qt or something. I would imagine MySQL offers an API as well.

    For actual graphics programming that has anything to do with the topic of this board, OpenGL and Direct3D are quite capable of 2D as well.
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    16
    What about C#?

    Does that has built-in graphics support, or do you need toolkits for that aswell in C#?

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    It doesn't matter, really, if the graphics support is "built-in" or not. You get the same result in the end.

    And if you're a veteran with C and C++, then use what you know.

    As for specific suggestions: the SDL is a really nice low-level graphics library. I've also heard good things about wxWidgets if you're looking for a GUI toolkit. Both of these are cross-platform.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    Haaf's Game Engine is a very powerful 2-D engine that supports most of the 2-D effects you will need. Easy to integrate with a Lua Script, and is exceptionally fast.
    http://hge.relishgames.com

  6. #6
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    There are some graphics capabilities offered by .NET, but I don't think they're intended for any real-time use. Generally they're used if you want to make your Windows Forms apps look "pretty". Although someone can correct me if I'm wrong.

    If you chose to use C#, XNA is available. But IMO, if you're going to take the time to learn XNA, you may as well learn Direct3D/DirectX instead and to it "properly" in C++ from the start.
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  7. #7
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    C# is very slow, and XNA games unless optimized ( or used on a bad.......... system ) are going to have low - mediocre framerates(15-30), but the same game made with C++/DirectX can achieve framerates of 100-150. That is based on my current system.

    Intel Core2 Duo 1.66mhz
    2048 mb of RAM
    Integrated Graphics device.
    edit: and 128 gig solid state hard-drive

  8. #8
    Registered User
    Join Date
    Jan 2007
    Posts
    16
    Quote Originally Posted by psychopath View Post
    There are some graphics capabilities offered by .NET, but I don't think they're intended for any real-time use. Generally they're used if you want to make your Windows Forms apps look "pretty". Although someone can correct me if I'm wrong.

    If you chose to use C#, XNA is available. But IMO, if you're going to take the time to learn XNA, you may as well learn Direct3D/DirectX instead and to it "properly" in C++ from the start.
    Real-time is not needed. It will be turn-based game overviewing a battlefield.

  9. #9
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    >> edit: and 128 gig solid state hard-drive

    Nice.

  10. #10
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Siphon View Post
    Real-time is not needed. It will be turn-based game overviewing a battlefield.
    C++
    With SQLite for persistent data storage, wxWidgets for GUI and SDL for 2D programming. Also mboost::asio for connection to server.

    Assuming client connects to server and server connects to central database. Aka three-tier application, and the proper setup under most circumstances.

    C#
    With SQLite and Managed Active X.

    Java
    With SQLiteJDBC and Java 2D.
    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.

  11. #11
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    To be honest, I would use Java for this little project. Its quick enough and portable enough that you should be in business without doing anything too special to a user's computer.

  12. #12
    deletedforumuser
    Guest
    If you are good enough with C++/C, i would suggest you to use SDL.

    Here's some great SDL tutorials.

    http://www.lazyfoo.net/SDL_tutorials/index.php

    SDL would be perfect for this small project.

    Now, you want to work with networking too. That's another thing.
    You would need a mysql library or something to work with.

    You could search one on google.

    If you still didn't know. C++ has nothing to do with graphics, C++ is the programming language you will use to actually program your stuff...Graphics is mainly done with the API you want to use. Ex: Directx. Directx would be suitable for a big project.

    I would suggest you to learn Directx, then, you will be able to work with a professional graphic engine and mainly updated.

    Oh well, Here's the deal.

    You can look for:

    Graphic engine(Library for C++/C)
    Mysql connector(Library for C++)

    You would need these two libraries to actually work with 3D and networking.

    If you want to work with a server/client application, i would suggest Winsock.

    Oh well, enough said. Cya.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MinGW Linking GUI Program
    By Tonto in forum Tech Board
    Replies: 19
    Last Post: 08-23-2006, 03:28 PM
  2. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  3. Visual C++ 2005 linking and file sizes
    By Rune Hunter in forum C++ Programming
    Replies: 2
    Last Post: 11-12-2005, 10:41 PM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. Video Games Industry. 5 years left.
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 12-10-2002, 10:52 PM