MFC for dong Graphics

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • MFC for dong Graphics

      Hello,

      I am curretnly designing a 'PacMan' game. I created
      a user interface using MFC. I would like to be able
      to draw my maze and load my BMP files. I have
      a intferface that will display a palyers name and points,
      (using the simple edit box) but I need some way of
      displaying my graphics, maze and pacman pics.
      Can I use the "Picture Control" to do graphics?
      if so, could I get some 'pointer/help' on what
      to do?

      Thank you

      Sabrina
    • RE: MFC for dong Graphics

      What did you a CView based SDI Application?
      Are you planning to use the GDI or used DirectX?
      Good advice depends on those answers

      you wont be too happy using a picture control and trying to animate your game You'd have more success doing blits right to the the device context of your CView class window

      see CBitmap, CDC and CView in the documention

      gb
    • RE: MFC for dong Graphics

      I haven't looked at it yet, but GDI+ might be helpful for a PacMan style game.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • RE: MFC for dong Graphics

      Hello,

      First, thank you for you comments and suggestions!

      I dont have any experience with SDI, GDI or DirectX, and
      I barely understand win32. (The collage I attend have
      no classes on these subjects either) As far as SDI or GDI,
      I am not sure what SDI is or if I need to download it. (?)
      I did try the GDI, after your advice, I placed the following
      into the code just to see if I what messages I would
      get
      #include <gdiplus.h>
      using namespace Gdiplus;

      But, I got some weird message, so I will have to keep
      looking for tutorials on GDI+.

      I was hoping to use MFC, cauz I thought it would do
      some of the work for me, for example, create an area
      where I could display the Pac-man maze and Pac-man
      pics, and an area that would let me display player points
      and player name. I have the basic form laid out in MFC,
      but I have no clue what to do next. I have a few books
      on MFC, but they are hard to understand, at least for me,
      So, I have gone back to using win32. I got some code
      from another tutorial website that has what I am looking
      for. It has a nice little window where I could put my maze
      into, and a nice dialog box where I can modify to put my
      down 'stuff' into, e.g. player name, and point. I changed
      a few things in the code to accommodate my needs but
      no success.

      I wrote my own BMP loader and I am using "Blit(..)"
      to display the graphics. So as to your advice on using
      blit(..), I am using it.

      I have all the pieces needed to make the Pac-man game,
      classes, bmp, maze engine, but its using the win32 code
      to get everything working and set up nicely.

      I have included a link to where my project is: I could use
      some help or advice on the how to aspect.

      69.9.206.137/

      Thank you,

      Sabrina
    • RE: MFC for dong Graphics

      Hello,

      I hope that you will forgive what I am about to ask but,
      I took your advice and went to libsdl.org and
      downlloaded the "SDL 1.0". I installed it. I let the compiler know I am using 3-party code.
      (Tools->Options->VC++ Directores, and I made a search
      path for the .h and .lib files) I looked at a tutorial web
      site :

      (sol.planet-d.net/gp/ch02.html)

      and found some code to test the compiler, Now I get an
      error "Test error LNK2001: unresolved external symbol "char * __cdecl SDL_GetError(void)" (?SDL_GetError@@$$J0YAPADXZ)"

      I guess the my first thought would be, the compiler is looking for the .h and .libs and the compiler can not find
      them. Here is what I put in the search path:
      "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\SDL-1.0.8\include"

      Then in the code I have "#include <SDL.h>"
      Am I right about that?

      Also, I have been reading that the Author uses boost
      (boost.org) for some pointer operations.
      I also downloaded it and installed it (THAT was REALLY
      confusing... their help files are not very friendly)
      I did the same for path searching "C:\Boost\boost_1_32_0\boost" and in my code I would
      use #include<boost/shared_ptr.hpp>
      Do I have this right also?

      After reading some chapters in the authors book, I am
      feeling SO inadequate about my programming skills. I will
      be graduating from collage soon and I after reading
      serveral topics I feel that when I go out into the work
      force I will be unprepared. So if it seems that I am a total
      noob at this, I am! But I figure if you get good advice
      from the experts, you will become an expert. I hope that
      you will be patient with me if I ask what might seem off
      the wall questions, or something that might be totally
      noobish :)

      Thank you again,

      Sabrina.
    • RE: MFC for dong Graphics

      Hey Sabrina,

      By the way installing Boost made ME feel like a noob. It's not one of the easier things to do. I've never installed the SDL libraries, but a linker error means you probably aren't including the .LIB file.

      Most 3rd party SDKs require you to speifically include the .LIB file in the Additional Dependancies item in the Linker->Input pane of the Solution properties.

      Bring this pane up by right-clicking on your solution in the solution explorer window in .NET, open the Linker folder under Configuration Properties, and select the Input item.

      At the end of the Additional Dependancies, add the name of the library file used by SDK.

      Hope that helps!
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • RE: MFC for dong Graphics

      Mike's probably right, the lib files always kill me.

      I never tried installing Boost, but using any 3rd party library tends to be an exercize, at the very least (getting mySQL and Lua together was insane).

      No programmer is good at everything, and few are turly good at anything. The important thing is develop the habits and techniques to overcome any problem in front of you, rather than having a library of specific solutions (that part just happens). I hardly qualify as more of an "expert" than you, I'm about to graduate from college myself.

      I've found the hardest part of figuring out how to fix problem in programming is actually figuring out what to ask.
      -Larrik Jaerico

      www.LarrikJ.com
    • RE: MFC for dong Graphics

      Originally posted by Larrik
      (getting mySQL and Lua together was insane).


      You got mySQL and Lua working together?!? That rocks! Using Lua for a data definition language? Or for scripting a game with a heavy data backend?

      You've made me very curious.... I've been thinking for some time that perhaps mySQL would be good for both content and saved game data.

      Rich
      "Your job is not to die for your country. Your job is to make some other poor sod die for his."

      The post was edited 1 time, last by Nebuchadnezzar ().

    • Hi,

      Thank you MrMike, I got Boost working now. (clap,clap, clap). I gave up (for now) on the SDK thing. I am still
      googling for help with set up and stuff.

      Also, I just noticed I spelled "doing" wrong, I wrote "Dong"
      as in "MFC doing graphics" (not sure what "dong" is or
      what it means.....LOL)

      Sabrina
    • RE: MFC for dong Graphics

      I sure did. In truth, getting Lua working with anything is a breeze, and mySQL in general is a bear, but the real issue was that mySQL wanted the multithreaded versions of the standard libraries, which causes a lot of strange errors until you figure it out (and even then, switching isn't as easy as it could be).

      If you want to AIM me (Larrik38), I can tell you what I'm using them for, but I'm not gonna post it
      -Larrik Jaerico

      www.LarrikJ.com
    • I didn't notice until you pointed it out!

      That's seriously funny.
      Mr.Mike
      Author, Programmer, Brewer, Patriot