xboxscene.org forums

Author Topic: Mind Looking At Some Code?  (Read 128 times)

platsajack

  • Archived User
  • Newbie
  • *
  • Posts: 5
Mind Looking At Some Code?
« 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!
Logged

Carcharius

  • Archived User
  • Sr. Member
  • *
  • Posts: 304
Mind Looking At Some Code?
« Reply #1 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
Logged

PedrosPad

  • Archived User
  • Hero Member
  • *
  • Posts: 1277
Mind Looking At Some Code?
« Reply #2 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");
Logged

platsajack

  • Archived User
  • Newbie
  • *
  • Posts: 5
Mind Looking At Some Code?
« Reply #3 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!
Logged

PedrosPad

  • Archived User
  • Hero Member
  • *
  • Posts: 1277
Mind Looking At Some Code?
« Reply #4 on: April 12, 2005, 03:23:00 AM »

QUOTE(platsajack @ Apr 12 2005, 08:39 AM)
EDIT::
Logged

d0wnlab

  • Archived User
  • Sr. Member
  • *
  • Posts: 326
Mind Looking At Some Code?
« Reply #5 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.
Logged

platsajack

  • Archived User
  • Newbie
  • *
  • Posts: 5
Mind Looking At Some Code?
« Reply #6 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.
Logged

d0wnlab

  • Archived User
  • Sr. Member
  • *
  • Posts: 326
Mind Looking At Some Code?
« Reply #7 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!
Logged