xboxscene.org forums

OG Xbox Forums => Software Forums => Development => Topic started by: platsajack on April 11, 2005, 10:42:00 PM

Title: Mind Looking At Some Code?
Post by: platsajack on April 11, 2005, 10:42:00 PM
#include <stdio.h>
#include <stdlib.h>
#include </usr/local/openxdk/include/hal/xbox.h>
#include </usr/local/openxdk/include/hal/fileio.h>
#include </usr/local/openxdk/include/openxdk/debug.h>
#include </usr/local/openxdk/include/SDL/SDL.h>

int width = 640;
int height = 480;
int bpp = 32;

void XBoxStartup()
{
   SDL_Init(SDL_INIT_VIDEO);
   SDL_Surface *screen = SDL_SetVideoMode(width, height, bpp, SDL_HWSURFACE);
   SDL_Surface *picture = SDL_LoadBMP("E:/Apps/main/image.bmp");
   SDL_BlitSurface(picture, NULL, screen, NULL);
   
   
XSleep(5000);
XReboot();   
}

Am I doing something incorrect here? once complied, I'd normally transfer this .xbe over to it's respective directory. However, no image shows. The image is indeed in the directory, however. After 5 seconds the xbox reboots as it should. Please, if at all possible, i'd appreciate some help, hehe - Or possibly a sound example illustrating how one of you ( the elite xbox devers ) would go about loading an image and blitting it.

Much thanks!
Title: Mind Looking At Some Code?
Post by: Carcharius on April 11, 2005, 11:28:00 PM
OK,

I'm guessing you're using the 0.06 binary release of OpenXDK and launching your xbe from something other than evolution-x.

Am I right?

The currently available binary (and indeed source) distributions of OpenXDK have issues regarding video setup. These issues mean you will only see video output when launching from evolution-x.

However, these issues are well and truly fixed in the current cvs code. So I'd suggest grabbing yourself a copy of the source from the sourceforge cvs and building it yourself.

Hope that helps

Carcharius
Title: Mind Looking At Some Code?
Post by: PedrosPad on April 12, 2005, 02:12:00 AM
QUOTE(platsajack @ Apr 12 2005, 04:48 AM)
SDL_Surface *picture = SDL_LoadBMP("E:/Apps/main/image.bmp");
Title: Mind Looking At Some Code?
Post by: platsajack on April 12, 2005, 02:33:00 AM
blink.gif  biggrin.gif

EDIT::
EUREKA! It worked! Muahaha, I'm an open source Xbox Developer now!
Hahaha, Life is wonderful!
Title: Mind Looking At Some Code?
Post by: PedrosPad on April 12, 2005, 03:23:00 AM
QUOTE(platsajack @ Apr 12 2005, 08:39 AM)
EDIT::
Title: Mind Looking At Some Code?
Post by: d0wnlab on April 12, 2005, 10:21:00 AM
just for reference, the / work too.

the libc calls implemented will convert the slashes (and convert to a proper NT disk like //partition6/...) automagically.
Title: Mind Looking At Some Code?
Post by: platsajack on April 12, 2005, 03:36:00 PM
Thanks downLab, I'll certainly keep that in mind. I'm really excited about xbox development. I'll also look into those sdl libraries that have been ported that you've listed in your sig. Esp sdl_image... bitmaps make the babies cry, hehe. Honestly, they're just too large. I'd prefer jpegs awesome compression for what I'm doing currently.
Anywho, thanks again. Your comment/suggestion is greatly appreciated and well noted.
Title: Mind Looking At Some Code?
Post by: d0wnlab on April 12, 2005, 04:10:00 PM
unfortunately jpeg isn't supported yet :/

I'm working on it though, should be soon.

 Good luck!