xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
> Sdlx And The Xdk
richi902
post Sep 4 2011, 07:41 PM
Post #1


X-S Enthusiast


Group: Members
Posts: 6
Joined: 4-September 11
Member No.: 456934



hi,

i'm trying to get one of the sdl samples running on the xbox from

http://lazyfoo.net/SDL_tutorials/lesson01/index2.php

i modified mine to look like this

CODE

#include "SDL.h"
#include "xstring"


//The Surfaces
SDL_Surface* Padel = NULL;
SDL_Surface* Screen = NULL;

//void __cdecl main()

SDL_Surface *load_image(std::string filename)
{
    //Temporary storage for the image that's loaded
    SDL_Surface* loadedimage = NULL;

    //The optimized image that will be used
    SDL_Surface* optimizedimage = NULL;

    //Load the image
    loadedimage = SDL_LoadBMP(filename.c_str());


    //if nothing went wrong in loading the image
    if(loadedimage != NULL)
    {
        //Create an optimized image
        optimizedimage = SDL_DisplayFormat(loadedimage);

        //Free the old image
        SDL_FreeSurface(loadedimage);
    }

    //Return the optimized image
    return optimizedimage;
}

void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination)
{
    //Make a temporary rectangle to hold the offsets
    SDL_Rect offset;

    //Give the offsets to the rectangle
    offset.x = x;
    offset.y = y;

    //Blit the surface
    SDL_BlitSurface(source, NULL, destination, &offset);
}

int main(int argc, char* args[])
{
    
    
    //Fireup SDL
    SDL_Init(SDL_INIT_EVERYTHING);
    //Setup SDL Screen
    Screen = SDL_SetVideoMode( 640, 480, 16, SDL_SWSURFACE | SDL_ANYFORMAT);
        
    //Window Name
    SDL_WM_SetCaption( "SDL Test APP", NULL );

    //Loading Bitmap
    Padel = load_image("image/sprite_one.bmp");
        
    //Apply image on screen
    apply_surface(180, 140, Padel, Screen);
    apply_surface(240, 80, Padel, Screen);

    //update the screen
    SDL_UpdateRect(Screen, 0, 0, 0, 0);

    //Pause
    SDL_Delay(15000);
    
    //Free the loaded image
    SDL_FreeSurface(Padel);
    
    //Quit SDL
    SDL_Quit();

    return 1;
    
}




it compiles fine but it displays no picture on the screen, just a black screen.
the bmp is in the main folder of the xbe on the xbox "e:/games/xbox_sdl/sprite_one.bmp"

i can confirm that the xbe itself is working, because if i change the amount of time for the
SDL_Delay it takes that amount of time to go back to the dash.

so my questen is, whats wrong?

i think 1 have sdlx correctly installed(Microsoft Xbox SDK\xbox\includes and \lib).

is there anything i need to keep in mind while porting windows stuff to the xbox?

oh and i have the latest xdk(59) and the sdlx from hyper_eve's svn
(compiled that in "trunk", i'm not really used to that svn stuff)


hope someone has a clue to fix my problem, thanks in advance uhh.gif


edit:
i forgot to add that it compiles and runs under windows fine and display the bmp

This post has been edited by richi902: Sep 4 2011, 07:44 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Hyper_Eye
post Sep 5 2011, 06:21 PM
Post #2


X-S Expert
***

Group: Members
Posts: 592
Joined: 26-December 03
From: Huntsvegas, AL.
Member No.: 85607
Xbox Version: v1.0
360 version: v1 (xenon)



He is aware of that. He just wants to skip that step because it holds up the build process. If you don't have a machine to deploy to that step takes a little bit before it fails. The instructions I provided allow you to disable deployment and avoid the issue. It makes building without a deployment target much faster.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
richi902
post Sep 27 2011, 03:26 AM
Post #3


X-S Enthusiast


Group: Members
Posts: 6
Joined: 4-September 11
Member No.: 456934



i installed a debug bios now anyway, i used that x2 bios so i can still keep my other dashboard.
it is much better to just press the button and it copys the new file over tongue.gif.
now i just need to learn more c(++) :/ gets too confusing sometimes, and i have a hard time understanding,
especially classes, functions and arrays(and probably some other stuff), well just the hole c++ lol.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post







Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 24th May 2013 - 07:24 AM