forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

psp coding tutorial lesson 4 help? (Solved)

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
ravenlife



Joined: 27 Apr 2006
Posts: 4

PostPosted: Thu Apr 27, 2006 10:17 am    Post subject: psp coding tutorial lesson 4 help? (Solved) Reply with quote

alright guys.

im just learning how to do all this - im currently on the 4th lesson http://www.scriptscribbler.com/psp/tutorials/lesson04.htm

im having a problem though

as far asa i can tell - i have done everything that it says in the tutorial - but upon compiling i get the following messages


anybody give me a boot in the right direction with this - ive spent two hours looking at it now - and nothings jumping out at me.
thanks

RavenLife


Code:
//test picture shit - mughahahah

#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include "graphics.h"

#define printf pspDebugScreenPrintf
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))

PSP_MODULE_INFO("Image Display Program", 0, 1, 1);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
          sceKernelExitGame();
          return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
          int cbid;

          cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
          sceKernelRegisterExitCallback(cbid);

          sceKernelSleepThreadCB();

          return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
          int thid = 0;

          thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
          if(thid >= 0) {
                    sceKernelStartThread(thid, 0, 0);
          }

          return thid;
}

int main() {
          char buffer[200];
          Image* ourImage;
         
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
// all of the above was a setup for the following program

sprintf(buffer, "ourImage.png");
ourImage = loadImage(buffer);
//the following four lines checks to see if the image has loaded
          if (!ourImage) {
                    //Image load failed
                    printf("Image load failed!\n");
          } else {
// if there were no errors the following 3 lines will execute
                    int x = 0;
                    int y = 0;
                    sceDisplayWaitVblankStart();
                   
//loop through the entire screen. The screen is 480 pixels wide and 272 pixels high:
                    while (x < 480) {
                              while (y < 272) {
//display image
                                        blitAlphaImageToScreen(0 ,0 ,32 , 32, ourImage, x, y);
                                        y += 32;
                              }
                              x += 32;
                              y = 0;
                    }
//now to write to the screen (flipping)
                    flipScreen();
          }

//shut down the program - allowing us to see the end product
          sceKernelSleepThread();
          return 0;
}



Last edited by ravenlife on Thu Apr 27, 2006 8:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
cheriff
Regular


Joined: 23 Jun 2004
Posts: 262
Location: Sydney.au

PostPosted: Thu Apr 27, 2006 10:40 am    Post subject: Reply with quote

Quote:
error: graphics.h: No such file or directory

You are telling gcc that the file graphics.h (which contains definitions for all Image related things, i guess) is in the SAME directory as main.c. Looks to me like this isnt the case.
Dunno where that file is, or where it's supposed to be.. But that's your problem. If it's included with the sdk (in /usr/local/pspdev/psp/sdk/include) then you need to use #include <graphics.h> instad of the ""'s
_________________
Damn, I need a decent signature!
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Apr 27, 2006 11:21 am    Post subject: Reply with quote

Quote:
My AIM is Yeldarb2k3, and my e-mail is Yeldarb [at] Barbdwyer [dot] com.

Why not ask the author of the 'tutorial' instead of people who aren't even connected to that site?

Does he even visit these forums?
Back to top
View user's profile Send private message Visit poster's website
Ats



Joined: 05 Dec 2005
Posts: 37
Location: Biarritz - France

PostPosted: Thu Apr 27, 2006 11:46 am    Post subject: Reply with quote

Reads carefully the tutorial n°4 :)
You have to download this file and unzip it in the folder where is your main.c
Back to top
View user's profile Send private message Visit poster's website
ravenlife



Joined: 27 Apr 2006
Posts: 4

PostPosted: Thu Apr 27, 2006 8:21 pm    Post subject: Reply with quote

Quote:
Why not ask the author of the 'tutorial' instead of people who aren't even connected to that site?


because i dont have aim - seems as this is psp dev discussion - i thought you guys would be more helpful anyway - as i realised it was something i had done wrong - rather than the tut being wrong.

i was right
Quote:
You are telling gcc that the file graphics.h (which contains definitions for all Image related things, i guess) is in the SAME directory as main.c. Looks to me like this isnt the case.

and
Quote:
You have to download this file and unzip it in the folder where is your main.c


i'd downloaded and unzipped - but upon finishing my main.c i moved it to projects so i could navigate to it with cygwin - didnt even think to move the files i downloaded.

obviously very noobish of me. so i apologise for that.

thank you for all your help though

RavenLife
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group