Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Using compiled-in resources

Author
Message
Orac
18
Years of Service
User Offline
Joined: 16th May 2006
Location: Billingham
Posted: 10th Jan 2009 00:51
Hi All,

I've been experimenting with including my media as resources and had some success but now I'm stuck. I've created the resource.h and resource.rc files ok and added then into the solution. The solution compiles cleanly with no warnings or errors. But when I try to use the LoadResource() API call it can't find any of the compiled-in resources. I used the same code in a non-DarkGDK project and it works exactly as it should. Has anyone tried doing this and had any success or am I going to have to give it up?



There are only 10 types of people in the world.
Those who understand binary, and those who don't.
Orac
18
Years of Service
User Offline
Joined: 16th May 2006
Location: Billingham
Posted: 14th Jan 2009 15:26
No-one has any thoughts on this?

There are only 10 types of people in the world.
Those who understand binary, and those who don't.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 14th Jan 2009 15:45
Most people are using "C++ 2008 Express".

It does not have a resource editor in it, so they can not play in the area that you dealing with. This is why you are not getting any/many replies.
Orac
18
Years of Service
User Offline
Joined: 16th May 2006
Location: Billingham
Posted: 14th Jan 2009 15:52 Edited at: 14th Jan 2009 16:06
I am using "C++ 2008 Express" also. I have created the resource script manually in the editor. It compiles OK with the resource compiler and I see that the resulting .exe has increased in size, but the LoadResource() function does not work from within a DarkGDK program, but is OK if I compile a normal Windows program.

There are only 10 types of people in the world.
Those who understand binary, and those who don't.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 14th Jan 2009 21:57
I was attempting to do this a little while back, and was unsuccessful. The problem is that the DarkGDK functions simply won't load anything other than external files. You would have to extract the files at the start of your program and then clean up after.


My site, for various stuff that I make.
Orac
18
Years of Service
User Offline
Joined: 16th May 2006
Location: Billingham
Posted: 15th Jan 2009 10:06
It's a pity they chose to initialise DarkGDK the way they did. I think it would have been better if they had left the start up alone so that you could do your own initialisation and setting up first then maybe a call to some function (call it for example DarkInit()) which would be equivalent to the entry point of DarkGDK. I realise though, the idea was to keep things as simple as possible so as to encourage more people to 'have a go' at programming games without having to worry about setting up Windows and message loops etc.

There are only 10 types of people in the world.
Those who understand binary, and those who don't.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 15th Jan 2009 11:28 Edited at: 15th Jan 2009 11:52
You may be able to think outside of the DarkGDK box.

From "newsletter_issue_72"

Quote: "The long awaited update to DarkGDK has been released, available from the DarkGDK website, which includes support for some of the commands that DBPro users have been enjoying plus a few things DBPro users wish they had, including the ability to launch C++ commands right at the very start of the application execution (even before initialisation of the DarkGDK system) and the ability to run commands at the very end of the application too. There is also a new command which allows the default window to be changed first time around, rather than creating one DarkGDK window then resizing it."


I have not tried this yet, so I don,t know how one would do it.

EDIT: After looking at typical DarkGDK code, I can NOT see any code that would directly initialize the game engine. I can not see anything that should stop the loading of material from an EXE resource. The only thing that may be problematic could ???? possibly be the loading of a model object where one loads the *.X file and relies on this to load other separate files like the textures. I don't know if an *.X object can handle this sort of operation from the resource.
It may pay to start simply, and just load in a picture as the first step, to see if anything works.

Login to post a reply

Server time is: 2024-11-25 11:17:54
Your offset time is: 2024-11-25 11:17:54