IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SDL Discussion :

psp toolchain + sdl = 0


Sujet :

SDL

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Avatar de yvesall
    Profil pro
    Développeur de jeux vidéo
    Inscrit en
    Novembre 2006
    Messages
    208
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Développeur de jeux vidéo
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2006
    Messages : 208
    Par défaut psp toolchain + sdl : makefile
    voila j'aimerais comme certainement beaucoup d'autre, me lancer dans la programmation sur PSP, j'ai suivi ce tuto pour installer toolchain ainsi que les lib dont j'aurais besoin

    http://uruk-hai01.goldzoneweb.info/b...sp-sous-ubuntu

    lors d'une compilation simple (programme tout con avec de l'affichage par le printf() de la psp) ca marche sans problème, compilation et exécution
    mais pour la sdl c'est autre chose, la compilation ne passe pas et je ne trouve pas comment résoudre ca

    donc
    voila mon main.c

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    #include "pspfunc.h"
     
    PSP_MODULE_INFO("SDL test", 0, 1, 1); 
    PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
     
    int main()
    {
      SceCtrlData	pad;
      int		go = 1;
     
      SDL_Init(SDL_INIT_VIDEO);
     
      pspDebugScreenInit();
      SetupCallbacks();
     
      while (go)
        {
          sceCtrlReadBufferPositive (&pad,  1);
        }
      sceKernelSleepThread();
      return (0);
    }
    dans mon "pspfunc.h" il y a :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    #ifndef __PSPFUNC_H__
    # define __PSPFUNC_H__
     
    #include <pspkernel.h>
    #include <pspdebug.h> 
    #include <pspdisplay.h>
    #include <pspctrl.h>
     
    #include <SDL/SDL.h>
    #include <SDL/SDL_image.h>
     
    # define printf pspDebugScreenPrintf
     
    int	exit_callback(int arg1, int arg2, void *common);
    int	CallbackThread(SceSize args, void *argp);
    int	SetupCallbacks();
     
    #endif
    et mon Makefile

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
     
    TARGET 		=	SDLtest
    OBJS 		=	main.o\
    			pspfunc.o
     
    INCDIR		=
    CFLAGS 		=	-G4 -Wall -O3 -I/usr/local/pspdev/psp/include/SDL
    CXXFLAGS 	=	$(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS		=	$(CFLAGS)
     
     
    PSPSDK 		=	$(shell psp-config --pspsdk-path)
    PSPBIN 		=	$(PSPSDK)/../bin
     
    LIBDIR		=
    LDFLAGS		=
    STDLIBS 	=	-lSDLmain -lSDL_image -lSDL -lpng -ljpeg -lm -lz \
    -lpspsdk -lpspctrl -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lpsphprm
    LIBS		=	$(STDLIBS)$(YOURLIBS)
     
     
    EXTRA_TARGETS 	=	EBOOT.PBP
    PSP_EBOOT_TITLE =	sdltest
     
    PSPSDK		=	$(shell psp-config --pspsdk-path)
    SDL_CONFIG	=	/usr/local/pspdev/psp/bin/sdl-config
    DEFAULT_CFLAGS 	=	$(shell $(SDL_CONFIG) --cflags)
     
    include $(PSPSDK)/lib/build.mak
    et le resultat d'un make rebuild :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    rm -f SDLtest.elf  main.o pspfunc.o PARAM.SFO EBOOT.PBP EBOOT.PBP
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G4 -Wall -O3 -I/usr/local/pspdev/psp/include/SDL -D_PSP_FW_VERSION=150   -c -o main.o main.c
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G4 -Wall -O3 -I/usr/local/pspdev/psp/include/SDL -D_PSP_FW_VERSION=150   -c -o pspfunc.o pspfunc.c
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G4 -Wall -O3 -I/usr/local/pspdev/psp/include/SDL -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o pspfunc.o -lSDLmain -lSDL_image -lSDL -lpng -ljpeg -lm -lz -lpspsdk -lpspctrl -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lpsphprm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o SDLtest.elf
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o): dans la fonction � PSP_GL_Init �:
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:109: r�f�rence ind�finie vers � eglGetDisplay �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:109: r�f�rence ind�finie vers � eglGetError �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:110: r�f�rence ind�finie vers � eglInitialize �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:110: r�f�rence ind�finie vers � eglGetError �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:135: r�f�rence ind�finie vers � eglChooseConfig �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:135: r�f�rence ind�finie vers � eglGetError �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:143: r�f�rence ind�finie vers � eglCreateContext �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:143: r�f�rence ind�finie vers � eglGetError �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:144: r�f�rence ind�finie vers � eglCreateWindowSurface �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:144: r�f�rence ind�finie vers � eglGetError �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o): dans la fonction � PSP_GL_SwapBuffers �:
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:82: r�f�rence ind�finie vers � eglSwapBuffers �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o): dans la fonction � PSP_GL_MakeCurrent �:
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspgl.c:69: r�f�rence ind�finie vers � eglMakeCurrent �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x4): r�f�rence ind�finie vers � glBegin �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xc): r�f�rence ind�finie vers � glBindTexture �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x14): r�f�rence ind�finie vers � glBlendFunc �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x1c): r�f�rence ind�finie vers � glColor4f �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x2c): r�f�rence ind�finie vers � glDisable �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x34): r�f�rence ind�finie vers � glEnable �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x3c): r�f�rence ind�finie vers � glEnd �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x44): r�f�rence ind�finie vers � glFlush �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x4c): r�f�rence ind�finie vers � glGenTextures �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x54): r�f�rence ind�finie vers � glGetString �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x5c): r�f�rence ind�finie vers � glLoadIdentity �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x64): r�f�rence ind�finie vers � glMatrixMode �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x6c): r�f�rence ind�finie vers � glOrtho �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x74): r�f�rence ind�finie vers � glPixelStorei �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x7c): r�f�rence ind�finie vers � glPopAttrib �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x84): r�f�rence ind�finie vers � glPopClientAttrib �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x8c): r�f�rence ind�finie vers � glPopMatrix �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x94): r�f�rence ind�finie vers � glPushAttrib �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0x9c): r�f�rence ind�finie vers � glPushClientAttrib �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xa4): r�f�rence ind�finie vers � glPushMatrix �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xac): r�f�rence ind�finie vers � glTexCoord2f �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xb4): r�f�rence ind�finie vers � glTexEnvf �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xbc): r�f�rence ind�finie vers � glTexImage2D �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xc4): r�f�rence ind�finie vers � glTexParameteri �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xcc): r�f�rence ind�finie vers � glTexSubImage2D �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xd4): r�f�rence ind�finie vers � glVertex2i �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspgl.o):(.rodata+0xdc): r�f�rence ind�finie vers � glViewport �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspevents.o): dans la fonction � PSP_EventQuit �:
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c:274: r�f�rence ind�finie vers � pspIrKeybFinish �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspevents.o): dans la fonction � PSP_EventInit �:
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c:247: r�f�rence ind�finie vers � pspIrKeybInit �
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c:249: r�f�rence ind�finie vers � pspIrKeybOutputMode �
    /usr/local/pspdev/lib/gcc/psp/4.3.1/../../../../psp/lib/libSDL.a(SDL_pspevents.o): dans la fonction � PSP_PumpEvents �:
    /home/server/Projets/psp/psplibraries/build/SDL/src/video/psp/SDL_pspevents.c:112: r�f�rence ind�finie vers � pspIrKeybReadinput �
    collect2: ld a retourné 1 code d'état d'exécution
    make: *** [SDLtest.elf] Erreur 1
    je ne comprend rien a ce makefile pour toolchain
    et encore moins comment régler le problème
    quelqu'un aurait il la reponse ?

    PS: OS : ubuntu 8.04

  2. #2
    Membre très actif
    Profil pro
    Responsable technique
    Inscrit en
    Février 2006
    Messages
    366
    Détails du profil
    Informations personnelles :
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Responsable technique

    Informations forums :
    Inscription : Février 2006
    Messages : 366
    Par défaut
    Je ne peux pas t'aider, je code sous windows avec cygwin. Mais je doute que tu soit sur le bon forum. Pas mal de gens ici pensent qu'il faut le SDK officiel pour executer du code sur la psp lol. Cherche plutot sur les forum anglais tu auras de meilleurs resultats et plus rapidement.

  3. #3
    Membre éclairé
    Avatar de yvesall
    Profil pro
    Développeur de jeux vidéo
    Inscrit en
    Novembre 2006
    Messages
    208
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Développeur de jeux vidéo
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2006
    Messages : 208
    Par défaut
    le truc c'est que évidemment ps2dev.org est down depuis deux jours, et j'ai vraiment dui mal a trouver des forum ou autre qui parle de dev sous linux (pour la psp évidemment ^^)

  4. #4
    Rédacteur

    Avatar de loka
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2004
    Messages
    2 672
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Service public

    Informations forums :
    Inscription : Novembre 2004
    Messages : 2 672
    Par défaut
    Pour ma part, je dirais que tu es presque sur le bon forum, disons que ton cas est assez particulier des problèmes avec SDL habituels

    Au vu de ton problème, j'ai plus l'impression que c'est un problème de link, essayes peut être ça :

    LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix=`psp-config --psp-prefix`
    ou encore :

    export LDFLAGS="-L/usr/local/pspdev/psp/sdk/lib -lc -lpspuser -lpsputility"
    ./configure --host psp --prefix=/usr/local/pspdev/psp
    Si ça ne fonctionne pas, que te donnes ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    psp-config --pspsdk-path
    psp-config --psp-prefix

  5. #5
    Membre éclairé
    Avatar de yvesall
    Profil pro
    Développeur de jeux vidéo
    Inscrit en
    Novembre 2006
    Messages
    208
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Développeur de jeux vidéo
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2006
    Messages : 208
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    $ echo $(psp-config --pspsdk-path)
    /usr/local/pspdev/psp/sdk
    $ echo $(psp-config --psp-prefix)
    /usr/local/pspdev/psp
    pour ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix=`psp-config --psp-prefix`
    ou cela :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    export LDFLAGS="-L/usr/local/pspdev/psp/sdk/lib -lc -lpspuser -lpsputility"\
    ./configure --host psp --prefix=/usr/local/pspdev/psp
    j'ai ca en retour :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    $ make rebuild
    rm -f SDLtest.elf  main.o pspfunc.o PARAM.SFO EBOOT.PBP EBOOT.PBP
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G4 -Wall -O3 -I/usr/local/pspdev/psp/include/SDL -D_PSP_FW_VERSION=150   -c -o main.o main.c
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G4 -Wall -O3 -I/usr/local/pspdev/psp/include/SDL -D_PSP_FW_VERSION=150   -c -o pspfunc.o pspfunc.c
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G4 -Wall -O3 -I/usr/local/pspdev/psp/include/SDL -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib "-L`psp-config --pspsdk-path`/lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix=`psp-config --psp-prefix`   main.o pspfunc.o -lSDLmain -lSDL_image -lSDL -lpng -ljpeg -lm -lz -lpspsdk -lpspctrl -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lpsphprm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o SDLtest.elf
    psp-gcc: ./configure : Aucun fichier ou dossier de ce type
    psp-gcc: psp : Aucun fichier ou dossier de ce type
    make: *** [SDLtest.elf] Erreur 1
    nul part je ne trouve de makefile qui fait ca (a croire que tout le monde préfère cygwin a un vrai unix/linux pour dev sur psp (quel manque de gout ))

    franchement ce problème de compil dépasse de tres loin mes connaissances

  6. #6
    Membre éclairé
    Avatar de yvesall
    Profil pro
    Développeur de jeux vidéo
    Inscrit en
    Novembre 2006
    Messages
    208
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Développeur de jeux vidéo
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2006
    Messages : 208
    Par défaut
    youhou en fouillant de partout (jusqu'au site russe :s) j'ai trouver quelque chose qui marche

    voila le makefile (remis a ma sauce sur pas mal de ligne)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    OBJS		=	main.o\
    			pspfunc.o
     
    TARGET		=	sdltest
     
    CFLAGS		=	-O2 -g -Wall -DDEBUG
     
    LIBS		=
     
    LIBDIR		=
     
    LDFLAGS		=
     
    EXTRA_TARGETS	=	EBOOT.PBP #kxploit
     
    PSP_EBOOT_TITLE	=	SDLTEST
     
    PSPSDK		=	$(shell psp-config --pspsdk-path)
     
    PSPBIN		=	$(PSPSDK)/../bin
     
    CFLAGS		+=	$(shell $(PSPBIN)/sdl-config --cflags)
     
    LIBS		+=	-lSDL_mixer -lvorbisidec -lSDL_image -lpng -lz -ljpeg $(shell $(PSPBIN)/sdl-config --libs)
     
    include $(PSPSDK)/lib/build.mak
    #kxploit est commenté parce que je sais pas c'est quoi mais en le laissant ca me crée un dossier au nom de l'application.

    voila un fichier main.c qui va avec :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    #include "pspfunc.h"
     
    //PSP_MODULE_INFO("SDL test", 0, 1, 1); 
    PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
     
    int main()
    {
      SceCtrlData	pad;
      int		go = 1;
      SDL_Surface	*ecran = NULL;
      SDL_Surface	*image = NULL;
      SDL_Rect	pos;
     
      SDL_Init(SDL_INIT_VIDEO);
      ecran = SDL_SetVideoMode(480, 272, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
      SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 0, 0, 0));
      image = IMG_Load("image.png");
     
      pos.x = ecran->w / 2 - image->w / 2;
      pos.y = ecran->h / 2 - image->h / 2;
     
      pspDebugScreenInit();
      SetupCallbacks();
     
      while (go)
        {
          sceCtrlReadBufferPositive (&pad,  1);
          if (pad.Buttons & PSP_CTRL_UP)
    	pos.y--;
          else if (pad.Buttons & PSP_CTRL_DOWN)
    	pos.y++;
          else if (pad.Buttons & PSP_CTRL_LEFT)
    	pos.x--;
          else if (pad.Buttons & PSP_CTRL_RIGHT)
    	pos.x++;
          SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 0, 0, 0));
          SDL_BlitSurface(image, NULL, ecran, &pos);
          SDL_Flip(ecran);
        }
      SDL_FreeSurface(image);
      SDL_FreeSurface(ecran);
      SDL_Quit();
      sceKernelSleepThread();
      return (0);
    }
    bizarrement j'ai du commenter la ligne
    PSP_MODULE_INFO("SDL test", 0, 1, 1);
    sinon j'avais une multiple définition de "module_info"
    et faisant référence a ma fonction main()

    HF tout le monde et merci loka et drcd !!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Programmation graphique ... SDL ??
    Par Franck.H dans le forum C
    Réponses: 9
    Dernier message: 29/04/2004, 20h51
  2. [SDL] manipulation d'image
    Par zdra dans le forum OpenGL
    Réponses: 4
    Dernier message: 28/02/2004, 16h56
  3. un plateau en SDL...
    Par maniaco_jazz dans le forum Autres éditeurs
    Réponses: 6
    Dernier message: 24/02/2004, 16h48
  4. [Debutant] Sdl & OpenGl link ne marche pas
    Par Riko dans le forum OpenGL
    Réponses: 9
    Dernier message: 18/02/2004, 16h13
  5. [opengl et sdl]
    Par Gonath dans le forum OpenGL
    Réponses: 6
    Dernier message: 08/12/2003, 09h49

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo