My Game Engine

This is a discussion on My Game Engine within the Windows Programming forums, part of the Platform Specific Boards category; We'll I've been working pretty hard on a 2D game engine in DirectX. I think it is coming along well. ...

  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    7

    Cool My Game Engine

    We'll I've been working pretty hard on a 2D game engine in DirectX. I think it is coming along well. I want to know what you experts on C++ and Windows think about it, what should I add, what should I fix? So far its has 2d graphics, can play midi, wav, and mp3 music, and uses direct input mouse and keyboard. I am also going to add online capabilities to it, but before that I want to know things I need to make better and change so I dont get in over my head. Thanks for looking at it!

  2. #2
    Registered User
    Join Date
    Feb 2004
    Posts
    7

    woops

    i completely forgot to say where it is, you can find it at http://shadowarts.ath.cx/projects/gecko/index.php

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    7

    Unhappy

    well i guess no one cares, i was just hoping someone would look at it and give me advice on what else today, ill go back to my cave then

  4. #4
    Registered User
    Join Date
    Oct 2003
    Posts
    29
    I sit on this forum pressing F5 all day.

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    13

    Criticism

    I attempted to compile your code, and I got a bijillion linker errors. I didn't have the patience to fix them, but it looks like directx linker errors.

    Your OnIdle() function is crazy. You have a lot of checks in there that seem a bit excessive. I didnt take the time to read it all yet, but I will continue to look it over, but just from glancing over it, what are all those checks used for??

    Also, I see a lot of inefficencies within your code. It seems you do a LOT of if checks and crazy checks all the time. Try to find a more efficient way to check all that information and your code will potentially run a lot smoother (not sure how it runs, couldnt run it).

    One last recommendation, if you want people to read your code and not complain, definately set up a commenting standard for yourself and use it. Explain what the code does and how it works within the headers and it will make other peoples life a lot easier.

    Hope these few things can potentially help you in your work. Let me know if you have any specific questions

  6. #6
    Registered User
    Join Date
    Feb 2004
    Posts
    7
    well you have to include the directx libraries, some of the error checks were from debugging but i know what you mean , like i could remove this section the parts checking DDraw.lppdsPrimary and bActive, because I have new code to handle those , mose of my class funtions check for nulls because I am planning on this being reused by others and I want to stop fatal errors. The onIdle is a bit crazy, it is all testing code but I do need to work on a bit of a cleanup before I start anything else new . I haven't noticed any performace issues though.

  7. #7
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    What libraries (*.lib) did you add to the project. I'm especially looking for the DirectShow lib, since I can't find anything similar to DShow.lib in the SDK folder.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  8. #8
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Oh, never mind. Found it - strmiids.lib.

    Another thing. Doesn't these objects need to be released when exiting the program? I saw no such thing in your code.
    Last edited by Magos; 03-03-2004 at 03:00 PM.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  9. #9
    Registered User
    Join Date
    Feb 2004
    Posts
    7
    the classes have them, i created a :estroy for all of the classes has the ->Release() funtion in them. The WM_CLOSE message on the MainWindowProc calls these when the program is quitting

    lol, the : and D in :estroy made a simlie

  10. #10
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    But the DirectShow object (mp3 player) doesn't have one. I checked the DX docs, and there doesn't seem to be any release methods for it either. I just wanted to be sure I don't have any memory leaks ^^.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  11. #11
    Registered User
    Join Date
    Feb 2004
    Posts
    7
    actually, its there.... look at the code in CDShow.cpp Line 140-150 its reads this:

    Code:
    bool CDShow::Destroy()
    {
    	if(lpdsmcMediaControl)
    		lpdsmcMediaControl->Release();
    	if(lpdsmpMediaPosition)
    		lpdsmpMediaPosition->Release();
    	if(lpdsgGraph)
    		lpdsgGraph->Release();
    
    	return true;
    }

  12. #12
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Um, CDShow.cpp only has 137 lines. You must've uploaded an older version, or updated it after I downloaded it. Download the attachment and check (I tried now, but the host is down).

    Anyway, I'll add the snippet you posted. Thanks for posting this engine anyway, it has been an inspiration ^^. Didn't know it would be this easy to play Mp3's (or wavs or mids for that matter) with DirectShow.
    Last edited by Magos; 03-06-2004 at 03:05 PM.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  13. #13
    Registered User
    Join Date
    Feb 2004
    Posts
    7
    when i first went to do it i thought it would be one of the hardest parts, but it turned out to be very easy

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ShellView as a Game Engine
    By Mastadex in forum Windows Programming
    Replies: 1
    Last Post: 01-21-2008, 03:51 PM
  2. Game Engine Link Prob
    By swgh in forum Game Programming
    Replies: 2
    Last Post: 01-26-2006, 12:14 AM
  3. KJ game engine
    By Lionmane in forum Game Programming
    Replies: 4
    Last Post: 11-18-2005, 06:16 AM
  4. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 02:47 PM
  5. game engine
    By onurak in forum Game Programming
    Replies: 1
    Last Post: 07-27-2002, 07:29 AM

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