This site is no longer active and is available for archival purposes only. Registration and login is disabled.

API for getting application directory?


API for getting application directory?

Postby mlepage » Aug 3, 2003 @ 4:42am

Using GapiDraw, it helpfully loads relative-path files from the application directory, when calling CGapiSurface::CreateSurface.

I would like to also load some of my data files from the application directory.

Is there a GapiDraw API that returns that directory for me, so I can load other files from there?

That would be best, since then I am sure whatever algorithm looks for the application directory for my image files, works the same for my other data files.

How do people normally do this?
mlepage
 


Postby efortier » Aug 3, 2003 @ 7:37pm

User avatar
efortier
pm Insider
 
Posts: 373
Joined: May 15, 2002 @ 10:32pm


OK

Postby mlepage » Aug 3, 2003 @ 10:17pm

User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby Guest » Aug 3, 2003 @ 10:22pm

Guest
 


It's not about laziness.

Postby mlepage » Aug 4, 2003 @ 1:59am

User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby fzammetti » Aug 4, 2003 @ 2:09am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby DillRye » Aug 4, 2003 @ 2:24am

Actually Anon was me, I too have the same problems where it looses my login as you do Fzam.

I am not hiding behind anything, but I often see posts demanding stuff of GapiDraw when it can be easily done by the person themself. Its not like coding the getPath instruction is more than 10 lines of code.

If someone cant handel "reinventing" 10 lines of code, they sure as heck should not be trying to make games. Why make a clone of a game, Its allready been done, and its reinventing the wheel?

I was just venting, since I constantly see posts about people begging SBL to impliment clipping and some various function that are absolutly trival. Now that clipping has been added, I will use it, but I didnt NEED it.

I also believe there becomes a point where you distance yourself soo far from the base code, that you dont even know what the hecks going on. I personally have written blitters, which do rotation/scaling and a few other various effects, but I choose to use GapiDraw since its such a wonderful feature set.

While I am abstracted with GapiDraw, I know whats going on at the base level. I dont think everyone needs to know, but when your complaning about a simple function that wont even take you a total of 5 min to impliment, I get a little miffed.

I entirely welcome questions, and creative thinking.
User avatar
DillRye
pm Insider
 
Posts: 477
Joined: Apr 25, 2002 @ 7:28am
Location: Iowa State University of Eng


Postby fzammetti » Aug 4, 2003 @ 2:50am

Well, I had a feeling it was one of the regulars that lost their logon, good thing I didn't go off too much :) Ironically, that problem for me seems to have gone away. Don't ask how or why, I haven't the slightest clue!

Obviously my coward comment doesn't apply to you, that was on the chance that it wasn't a regular.

In any case, I agree with you to an extent. I'm like you it seems in that I tend to WANT to do things myself, if for no other reason than to know every detail of what's going on. I frankly have to fight myself at work all the time, where all I do is Java all day, to actually look through the class libraries and other sources of code before diving in and writing every little thing myself. It's a little different when your being paid to code I think, but it's still true outside work.

I think the original point, which I think is valid, is that since GD is doing this already, exposing the functionality probably isn't a big deal, and if it saves us five minutes and takes Johan 30 seconds to implement it, then it's not a bad request. I think it's obviously something that should fall to the bottom of the long list, but it's not a bad request.

I also agree with you that people DO tend to come here sometimes and complain about things and "request" things be added that aren't really important, relatively speaking. I totally understand your need to vent sometimes :) But I didn't think mlepage was complaining at all. Granted, he probably could have written the code in the time it took to read the replies and type his own :)

Ah, in any case, I have some code to write myself, and this isn't getting that done either I suppose ;)
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Reexplaining

Postby mlepage » Aug 4, 2003 @ 4:46am

No worries guys. But let me explain the reasons again.

It's not laziness or inability. It's simple software engineering. Right now, I have two functions which attempt to do the same thing.

One function is mine, and seems to work as advertised. The other is hidden without an API, and doesn't seem to work as advertised by the documentation.

So these functions may differ in their results. In fact, I have found that they *do* differ in their results, when running my game from within Visual Studio.

So, I am risking putting my game in a position where it can find its configuration files, but not its image files, under some circumstances.

So, to properly manage this risk, I am forced to simply always use my function to obtain an absolute path, and always pass an absolute path into the GapiDraw image loading routines.

Don't you find it odd that I am forced to reimplement something that is in GapiDraw, and not use GapiDraw's version at all?

Now consider this: GapiDraw probably already has this API internally. It just needs to be exposed for our use. Then, I can remove my implementation of the same functionality. Then, even if that function somehow fails, at least my game is looking for everything in one place, and not two places.

I'm not asking for a feature that isn't already in GapiDraw. It's a low-hanging fruit. It probably only requires an entry in a header file.

It could be worse, I could be asking for const correctness. :-)
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby efortier » Aug 4, 2003 @ 5:30am

jheez...

I use GetModuleFileName() in all my projects, and I never had a single problem. Not on the desktop, not on Toshiba or iPaqs, and not from running in Visual Studio or eVC.

If some of your files cannot be found when you run the application from VS, check where your .EXE is created. Move it to your root folder or something.

And DillRye is right, this function is short. Mine has 4 lines plus the final "return S_OK". It gets the module name and get rids of the filename.

This is not brain surgery, this is making a freaking function.

I can't believe I'm still writing...

--Eric
User avatar
efortier
pm Insider
 
Posts: 373
Joined: May 15, 2002 @ 10:32pm


Functions

Postby mlepage » Aug 4, 2003 @ 6:23am

User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Postby maurice » Aug 4, 2003 @ 7:41am

maurice
pm Member
 
Posts: 37
Joined: Feb 26, 2003 @ 9:08pm
Location: Rotterdam


Postby Johan » Aug 4, 2003 @ 8:30am

Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


As suspected

Postby mlepage » Aug 4, 2003 @ 3:37pm

User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum