Archived

This topic is now archived and is closed to further replies.

kill

PR without winutil

Recommended Posts

Hi. I''m trying to initialize PR, but I don''t want to use the utilities class that comes with it. When I compile my code, I get a bunch of linking errors(unresolved externals). As far as I understand PR expects me to define a couple of functions, and to declare some variables. Is there a way to avoid this?

Share this post


Link to post
Share on other sites
Are you compiling your own code, or have you adapted any examples (such as the Land demo)? What externals are being reported as missing? You''ve included the necessary PR, DirectX and Windows libraries, right?

Share this post


Link to post
Share on other sites
Compiling my own code. I''ve included everything. I''m at work right now, so I can''t really say for sure what''s reported missing, but it was something like _hMainWnd, movex, movey(or some other functions declared in winutil that handle the mouse). I don''t include winutil in the project, so all this stuff is undefined. My guess is, it''s declared somewhere in PR, and I can''t figure out where.

Share this post


Link to post
Share on other sites
I just encountered this problem. My solution was to declare all the variables it required and create nonfunctional stub versions of the missing functions. You should be able to figure out the failure return values of the functions that return a value from winutils.c. That works for me but may be a problem with certain (input related?) functions.

I suggest you try doing that, unless you need PR_editstring and a few others.



Regards,
Ralph Potter
ralph.potter@digital-magi.com, http://www.digital-magi.com

Share this post


Link to post
Share on other sites
Yeah, I thought about that too. But this is just a short cut, it makes the code work, but it''s not a production type of solution. This doesn''t get to the bottom of things(which I want to do, to be sure the code won''t behave unpredictably).

Share this post


Link to post
Share on other sites
If you want production quality code, don''t remove vital parts of the engine

You can totally change the device selection dialog, remove it, store the setup in a configuration file or registry so it only appears once, etc.

I don''t understand why people are trying to remove winutil.c when it has all of the important Windows initialization routines for input and window creation. You need all of it.

I have made a version with stub functions, but that was for a screensaver that didn''t require any input.

Chris

Share this post


Link to post
Share on other sites
Chris, the reason I am trying to remove the file, is because I want to set up my own windows initialization routines, and my own game loop. I am working with C++, and I really prefer OOP, so I'm wrapping PR into C++ classes, and I really want my game code to look clean(from my point of view). I don't find winutil to be the cleanest file I've ever seen, and I don't want to make changes to it to accomodate me.

What I'll do, is that I'll probably fully rewrite this file...


Edited by - kill on June 15, 2000 9:34:51 AM

Share this post


Link to post
Share on other sites
Thats pretty much exactly the reason I had to do it. If anyone finds a better solution to this problem I'd be very interested to know. For the time being I'm left with a single file tucked into my project that I try not to look at if I can help it, 'cos it bugs me to know I can't get rid of those references. Unfortunately IIRC at least one of them came out of PR.lib file which I can't really do much about.

Regards,
Ralph Potter
ralph.potter@digital-magi.com, http://www.digital-magi.com

Edited by - digital-magi on June 15, 2000 9:48:15 AM

Share this post


Link to post
Share on other sites