Seite 331 von 340 ErsteErste ... 231 281 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 LetzteLetzte
Zeige Ergebnis 9.901 bis 9.930 von 10174

C/C++ Programming Help Thread

This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Why are you using OSLib ? o_O And I think the UMD functions in the M33 SDK will be of ...

  
  1. #9901
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Why are you using OSLib? o_O

    And I think the UMD functions in the M33 SDK will be of better use.



  2. #9902
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eldiablov Beitrag anzeigen
    Why are you using OSLib? o_O

    And I think the UMD functions in the M33 SDK will be of better use.
    coz its easy and thanks
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  3. #9903
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    I'd say that you're better off with libge.
    That epic dude.

  4. #9904
    xMod.
    Points: 4.576, Level: 43
    Level completed: 13%, Points required for next Level: 174
    Overall activity: 0%

    Registriert seit
    Oct 2008
    Ort
    Melbourne, Australia
    Beiträge
    675
    Points
    4.576
    Level
    43
    My Mood
    Daring
    Downloads
    0
    Uploads
    0

    Standard

    if (umdDetectedVariable == 0)
    {
    oslPrintf_xy(20, 240, "No UMD disc is inserted.");
    } else {
    oslPrintf_xy(20, 240, "UMD disc is inserted.");
    }
    If thinking when there is no UMD it doesn't return 0 and always executes the else statement
    I hate those monkeys ZOMG!
    -~Slasher~-
    http://i18.tinypic.com/4m848p5.gif

  5. #9905
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    i havent compared with my old code and i cant remember what i changed but got it to work now ...

    Code:
    #include <oslib/oslib.h>
    #include <pspumd.h>
    
    PSP_MODULE_INFO("Testing", 0, 1, 0);
    PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
    
    int main()
    {
        oslInit(0);
        oslInitGfx(OSL_PF_8888, 1);
        oslInitConsole();
    
        while (!osl_quit)
        {
            oslStartDrawing();
            oslCls();
    
            oslReadKeys();
    
    		oslPrintf_xy(20, 20, "Testing");
    
    		int umdCheck;
    		umdCheck = sceUmdCheckMedium();
    
    		if (umdCheck == 0)
    		{
    			oslPrintf_xy(20, 40, "No UMD present.");
    		} else {
    			oslPrintf_xy(20, 40, "UMD detected.");
    		}
    
            if (osl_keys->held.hold)
    		{
    			oslPrintf_xy(20, 250, "Hold Activated!");
    		}
            if (osl_keys->pressed.start)
    		{
    			break;
    		}
    
            oslEndDrawing();
            oslSyncFrame();
        }
    
        oslEndGfx();
        oslQuit();
    
        return 0;
    }
    and that is running in usermode as like i said i cant see umd functions being kernel
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  6. #9906
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    @slasher, the documentation clearly states that 0 is the proper return,
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  7. #9907
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Alright guys, n00b question.
    Why can't I get the toolchain to install.??
    And it skips the svn update.
    I used to have all this shiz until my dad deleted it, mistakenly thinking its a virus.
    Code:
    MY [email protected] ~
    $ ls
    psptoolchain
    
    MY [email protected] ~
    $ cd psptoolchain
    
    MY [email protected] ~/psptoolchain
    $ svn update
    Skipped '.'
    
    MY [email protected] ~/psptoolchain
    $ ls
    build  depends  patches  readme.txt  scripts  toolchain-sudo.sh  toolchain.sh
    
    MY [email protected] ~/psptoolchain
    $ ./toolchain.sh
    ERROR: Set $PSPDEV before continuing.
    ../depends/check-pspdev.sh: Failed.
    
    MY [email protected] ~/psptoolchain
    $

  8. #9908
    No longer a community member.
    Points: 46.662, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Beiträge
    22
    Points
    46.662
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von psphacker12. Beitrag anzeigen
    Why can't I get the toolchain to install.??
    It tells you in your output, you have to set the PSPDEV environment variable.
    Zitat Zitat von psphacker12. Beitrag anzeigen
    And it skips the svn update.
    That's because you have to provide it with a URL.

  9. #9909
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Hardrive Beitrag anzeigen
    It tells you in your output, you have to set the PSPDEV environment variable.
    Well how would I do that?
    That's because you have to provide it with a URL.
    Really I was reading this and it just says:
    Code:
    Due to a recent problem with the toolchain, we need to update everything, so to get the updates and have them modify the toolchain script, you will need to type "svn update" and hit enter.
    It just says type in svn update and hit enter




    EDIT: nvm guys lol i just forgot to input this: export PSPDEV=/usr/local/pspdev
    export PATH=$PATH:$PSPDEV/bin
    Geändert von psphacker12. (08-10-2009 um 11:41 AM Uhr)

  10. #9910
    Art
    Art ist offline
    Bush Programmer
    Points: 60.149, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    3.658
    Points
    60.149
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard Quick Question

    Hi Guys,
    I thought there was a way to check in one operation,
    if any buttons were pressed at all.
    Rather than checking each button individually.
    Anyone know how?

  11. #9911
    QJ Gamer Silver
    Points: 8.201, Level: 61
    Level completed: 17%, Points required for next Level: 249
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Sheffield, UK
    Beiträge
    844
    Points
    8.201
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Art Beitrag anzeigen
    Hi Guys,
    I thought there was a way to check in one operation,
    if any buttons were pressed at all.
    Rather than checking each button individually.
    Anyone know how?
    If i understand you correctly it would be this:

    Instead of doing
    Code:
    if (paddata.Buttons & PSP_CTRL_CROSS)
    {
    //some code here
    }
    you would do

    Code:
    if (paddata.Buttons)
    {
    //some code here
    }

  12. #9912
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    hey guys, does any1 know how to blit an image and make it "blink" ?
    That epic dude.

  13. #9913
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    I need help I still can't get cygwin to compile !!!


  14. #9914
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    did you install the psptoolchain ? coz it doesn't seem like it
    and cygwin sucks, you should better use pspdev or minpspw

    btw i still need help with my blinking problem
    That epic dude.

  15. #9915
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von mootjeuh Beitrag anzeigen
    hey guys, does any1 know how to blit an image and make it "blink" ?
    blit the image oslib is good to use for most stuff, make a counter, incrememnt the counter, if the counter is less than a certain value then blit the image if it is more then dont, reset the counter when it reaches a certain value.

    you could also use a timer to do this, it would be a bit harder but more efficient and not loop dependant.

    Zitat Zitat von psphacker12. Beitrag anzeigen
    I need help I still can't get cygwin to compile !!!
    google: minpspw
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  16. #9916
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von mootjeuh Beitrag anzeigen
    did you install the psptoolchain ? coz it doesn't seem like it
    and cygwin sucks, you should better use pspdev or minpspw

    btw i still need help with my blinking problem
    Do you have a link for any other compilers than cygwin?
    Because I hate that thing.

  17. #9917
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    read up
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  18. #9918
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    Zitat Zitat von psphacker12. Beitrag anzeigen
    Do you have a link for any other compilers than cygwin?
    Because I hate that thing.
    Let me Google that for you
    That epic dude.

  19. #9919
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Hey guys, I have Minpspw, and Eclipse up and running, and I would like to know how to install libpng and zlib onto it? I have cygwin, and already used svn checkout to get them, I have a libpng folder, and a zlib folder, where do I put them to be able to use with Eclipse?? Thanks

  20. #9920
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    sigh

    steps:
    1. delete cygwin
    2. use windows
    3. use any normal text editor
    4. read the minpspw documentation

    Installed libs on minpspw by default:

    Code:
    zlib
    bzip2
    freetype
    jpeg
    libbulletml
    libmad
    libmikmod
    libogg
    libpng
    libpspvram
    libTremor
    libvorbis
    lua
    pspgl
    pspirkeyb
    sqlite
    SDL
    SDL_gfx
    SDL_image
    SDL_mixer
    SDL_ttf
    smpeg
    ode
    libpthreadlite
    cal3D
    mikmodlib
    cpplibs
    flac
    giflib
    libpspmath
    pthreads-emb
    tinyxml
    oslib
    libcurl
    intrafont
    Jello
    zziplib
    Mini-XML
    by the looks of things im thinking that you havent got a clue what the hell you are doing, nevermind programming in C
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  21. #9921
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FaT3oYCG Beitrag anzeigen
    by the looks of things im thinking that you havent got a clue what the hell you are doing, nevermind programming in C
    Erm maybe I d/led an older version? Redownloading minpspw, and deleting cygwin.
    AND I NEED TO: :rtfm:

    Yup i checked what version i had, i had 0.7.1. the newest one is 0.9.5. So I guess thats why I didn't have the libs?
    Either way it should (hopefully) work now.

    Okay I read the readme for Minpspw and it says that it is the only thing that I need to create homebrew on the psp, but I can't seem to find a compiler...? Isn't there supposed to be a compiler that comes with the program, I can't find any. I've tried compiling it with the windows cmd, but that doesn't work.
    Please don't think that I'm a dumbass...
    Geändert von psphacker12. (08-11-2009 um 04:18 AM Uhr)

  22. #9922
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    erm, you cd into the directory of your code when you have a makefile and script with the required libs and then type make
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  23. #9923
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Ok it works when I compile an audio tester, but with hello world it has some errors...?


    Code:
    C:\>cd projects
    
    C:\PROJECTS>cd test
    
    C:\PROJECTS\TEST>make
    psp-gcc -I. -IC:/pspsdkdevkit/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=15
    0   -c -o main.o main.c
    main.c:37: warning: data definition has no type or storage class
    main.c:37: warning: type defaults to 'int' in declaration of 'pspDebugScreenInit
    '
    main.c:37: error: conflicting types for 'pspDebugScreenInit'
    C:/pspsdkdevkit/psp/sdk/include/pspdebug.h:32: error: previous declaration of 'p
    spDebugScreenInit' was here
    main.c:38: warning: data definition has no type or storage class
    main.c:38: warning: type defaults to 'int' in declaration of 'SetupCallbacks'
    main.c:39: error: expected declaration specifiers or '...' before string constan
    t
    main.c:39: warning: data definition has no type or storage class
    main.c:39: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
    tf'
    main.c:39: error: conflicting types for 'pspDebugScreenPrintf'
    C:/pspsdkdevkit/psp/sdk/include/pspdebug.h:49: error: previous declaration of 'p
    spDebugScreenPrintf' was here
    main.c:40: warning: data definition has no type or storage class
    main.c:40: warning: type defaults to 'int' in declaration of 'sceKernelSleepThre
    ad'
    main.c:41: error: expected identifier or '(' before 'return'
    main.c:42: error: expected identifier or '(' before '}' token
    make: *** [main.o] Error 1
    I attached my files,
    Angehängte Dateien Angehängte Dateien
    • Dateityp: zip src.zip (810 Bytes, 16x aufgerufen)
    Geändert von psphacker12. (08-11-2009 um 05:55 AM Uhr)

  24. #9924
    No longer a community member.
    Points: 46.662, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Beiträge
    22
    Points
    46.662
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von psphacker12. Beitrag anzeigen
    Ok it works when I compile an audio tester, but with hello world it has some errors...?
    You can't even copy and paste the tutorials correctly, can you?

    Put this line:
    Code:
    int main() {
    above this line:
    Code:
    pspDebugScreenInit();

  25. #9925
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Thanks, Hardrive, well I was in a rush when I was copy/pasting it because my dad needed to get on the comp. , so I must've skipped over that part. I may be a n00b , but its a good learning experience.
    I deserve a facepalm.

  26. #9926
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    *facepalm* you should really look into the basics of C and how libs work aswell as learning programming logic before you continue.
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  27. #9927
    likes kittens....awww....
    Points: 6.975, Level: 55
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Detroit
    Beiträge
    628
    Points
    6.975
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Umm ok I have one more question, how do you put text over an image that you blitted to the screen? When I try to do it using the font sample included in the samples, It works but The image doesn't show up in the background, and well , the text is parts of the image.
    Code:
    int main(int argc, char **argv)
    {
    	scePowerSetClockFrequency(333, 333, 166); 
        char buffer[200];
        Image* bg;
        pspDebugScreenInit();
    	SetupCallbacks(); 
    	initGraphics(); 
        SceCtrlData pad; 
        
        int thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
    	if(thid >= 0) {
    		sceKernelStartThread(thid, 0, 0);
    	}
    
    	sceGuInit();
    	sceGuStart(GU_DIRECT, list);
    	sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
    	sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
    	sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
    	sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
    	sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
    	sceGuDepthRange(0xc350,0x2710);
    	sceGuScissor(0,0,SCR_WIDTH,SCR_HEIGHT);
    	sceGuEnable(GU_SCISSOR_TEST);
    	sceGuDisable(GU_DEPTH_TEST);
    	sceGuShadeModel(GU_SMOOTH);
    	sceGuEnable(GU_BLEND);
    	sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
    	sceGuEnable(GU_TEXTURE_2D);
    	sceGuTexMode(GU_PSM_8888, 0, 0, 0);
    	sceGuTexImage(0, 256, 128, 256, font);
    	sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
    	sceGuTexEnvColor(0x0);
    	sceGuTexOffset(0.0f, 0.0f);
    	sceGuTexScale(1.0f / 256.0f, 1.0f / 128.0f);
    	sceGuTexWrap(GU_REPEAT, GU_REPEAT);
    	sceGuTexFilter(GU_NEAREST, GU_NEAREST);
    	sceGuFinish();
    	sceGuSync(0,0);
    	sceGuDisplay(GU_TRUE);
    
     
        sprintf(buffer, "bg.png");
        bg = loadImage(buffer); 
    
    
        
    
                        
        if (!bg) {
                        //Image load failed
                        printf("Image load failed!\n");
               } else { 
                        int x = 0;
                        int y = 0;
                        sceDisplayWaitVblankStart(); 
                        while (x < 480) {
                                  while (y < 272) {
                                        blitAlphaImageToScreen(0 ,0 ,480 , 272, bg, x, y);
                                            y += 272;
                                  } 
                                  x +=480;
                                  y = 0;
                        } 
                
              } 
        
        flipScreen();
            while(1) {
    		sceGuStart(GU_DIRECT, list);
    		sceGuClear(GU_COLOR_BUFFER_BIT);
    
    		/*
    			No matrixes are needed because the font is drawn with GU_TRANSFORM_2D
    		*/
    
    		drawString("Hello World in red",   0,  0, 0xFF0000FF, 0);
    		drawString("Hello World in green", 0, 16, 0xFF00FF00, 0);
    		drawString("Hello World in blue",  0, 32, 0xFFFF0000, 0);
    
    		drawString("Hello World with free char width",     0, 64, 0xFFFFFFFF, 0);
    		drawString("Hello World with block char width 10", 0, 80, 0xFFFFFFFF, 10);
    		drawString("Hello World with block char width 12", 0, 96, 0xFFFFFFFF, 12);
    
    		drawString("Hello World with opacity 100%", 0, 128, 0xFFFFFFFF, 0);
    		drawString("Hello World with opacity  50%", 0, 144, 0x7FFFFFFF, 0);
    		drawString("Hello World with opacity  10%", 0, 160, 0x18FFFFFF, 0);
    
    		drawString("Hello World with shadow", 2, 194, 0x40FFFFFF, 0);
    		drawString("Hello World with shadow", 0, 192, 0xFFFFFFFF, 0);
    
    		static float t = 0.0f;
    		t += 0.1f;
    
    		unsigned int c = 0xFF000000 |
    			(unsigned int)((sinf(t * 0.393f + 0.086f) / 2.0f + 0.5f) * 255.0f) << 16 |
    			(unsigned int)((sinf(t * 0.444f + 0.854f) / 2.0f + 0.5f) * 255.0f) <<  8 |
    			(unsigned int)((sinf(t * 0.117f + 1.337f) / 2.0f + 0.5f) * 255.0f) <<  0;
    
    		drawString("Hello World from pspdev", 0, 224, c, 0);
    
    		sceGuFinish();
    		sceGuSync(0, 0);
    
    		sceDisplayWaitVblankStart();
    		sceGuSwapBuffers();
    	}
    
    	sceGuDisplay(GU_FALSE);
    	sceGuTerm();   
                
                                  
                        flipScreen();
    
                       
                                  sceDisplayWaitVblankStart();
              
    
    
              return 0;
    }

  28. #9928
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    search about oslib
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  29. #9929
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von psphacker12. Beitrag anzeigen
    Umm ok I have one more question, how do you put text over an image that you blitted to the screen? When I try to do it using the font sample included in the samples, It works but The image doesn't show up in the background, and well , the text is parts of the image.
    Look at what your code is doing line by line. If you don't understand the code that you yourself have written, then there is no point telling what is wrong with it.

  30. #9930
    Developer
    Points: 8.125, Level: 60
    Level completed: 88%, Points required for next Level: 25
    Overall activity: 0%

    Registriert seit
    May 2009
    Ort
    RetroEmu
    Beiträge
    116
    Points
    8.125
    Level
    60
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    Setting up cygwin is easy. I cannot understand how so many people have issues with it.

    I will do up a guide when I get time to explain it step by step. It really isn't hard.
    My PSP Releases :






 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:15 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .