xboxscene.org forums

Author Topic: Sfonts And Openxdk  (Read 57 times)

d0wnlab

  • Archived User
  • Sr. Member
  • *
  • Posts: 326
Sfonts And Openxdk
« on: December 29, 2004, 08:40:00 AM »

I've gotten SFonts to work.  If you can't get it after this I can send you a beta copy of my app I'm working on with an example of SFonts working.

  That error points to what you probably did was, in the main executable source file your main entry point is probably called main() or winmain() still..  it has to be XboxStartup().

What I do so I can cross compile my SDL apps is I set up mirrored makefiles (one for linux target, one for XBOX target) and I make my entry point declared as:

CODE

#ifdef ENABLE_XBOX
  void XBoxStartup()
#else
  int main(int argc, char **argv)
#endif


if you're going to do that you also have to wrap any other XBox-specific code with #ifdef ENABLE_XBOX / #endif and any computer-specific code with #ifndef ENABLE_XBOX / #endif..

Note that you also have to have in your XBOX makefile -DENABLE_XBOX in your C flags.  This is usually there by default if you copied a makefile from the source tree.

EDIT: I should mention that compiling the test apps included with the program usually requires enough modification.  Things like file paths, for example.  On the XBOX you don't have the concept of a working directory, BUT the directory that you run the XBE in gets mapped to the D drive.  So if you want to access say, a font file in the same directory as the XBE you have to specify it as "d:/font1.bmp".

Also, you'll have to not use PNG files yet.  AND You'll have to edit the IMG_Load statement because that's an SDL_Image library function and SDL_Image isn't natively supported yet.  I _DO_ have a beta copy of SDL_Image working that can load BMP and GIF and I'll send it to you if you want, but that's it right now.. I'm working on PNG and JPEG before it's released.  However there is a native SDL function to load a BMP and you could use that instead of IMG_Load for the time being.
Logged

d0wnlab

  • Archived User
  • Sr. Member
  • *
  • Posts: 326
Sfonts And Openxdk
« Reply #1 on: December 29, 2004, 03:31:00 PM »

I have no problem sending you my WIP stuff.  However, I'm 8 hours away from an XBox until the 3rd-ish.  I do have a copy of sdl_Image and I'll email you that in a bit (Got the PM), but I'll wait on the SFont example just because I've edited it and it runs in linux but I can guarentee I have to mod it to get it to work on the XBox.  I'll hack it up real quick when I get back home and send you something I know works.

Until then, good luck! (and I'll send you my sdl_Image stuff..)

Logged

nangsyde

  • Archived User
  • Newbie
  • *
  • Posts: 12
Sfonts And Openxdk
« Reply #2 on: January 03, 2005, 02:11:00 AM »

Thanks for the help again, this one I've got compiling now and was just me being stupid.  Having said that it still doesn't work, but downlab's sending me an example which works, so I should be able to see what I'm doing wrong from that.  Thanks for the help
Joe
Logged