| View previous topic :: View next topic |
| Author |
Message |
^L^
Joined: 14 Jun 2008 Posts: 19
|
Posted: Sat Jun 14, 2008 1:15 pm Post subject: [C Help] Graphics Confusion |
|
|
Meh...
I've tried sooo hard.
I've looked for such a long time and posted in many, many places...
I want to make a game, but I don't know how to properly display graphics on the PSP using C.
I did many tutorials, but none of them help me out with what I need.
Can someone post a sample in C for what is needed to blit a white pixel on the screen and move it around with the D-Pad using X and Y variables?
I know C very well, and I've created many text based programs. I want to take the next step and develop an actual game.
This would help me out very greatly. Thanks in advance!
^L^ |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
|
| Back to top |
|
 |
^L^
Joined: 14 Jun 2008 Posts: 19
|
Posted: Sat Jun 14, 2008 11:15 pm Post subject: |
|
|
Thanks very much for this. However, both of those have a lot of extra coding for TV Out. I was wanting just a simple example.
I was wanting something simple like this....
| Code: | int x=70;
int y=70;
int main() {
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
printf("Test");
while(1){
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_UP) {
y-=1;
}
if(pad.Buttons & PSP_CTRL_DOWN) {
y+=1;
}
if(pad.Buttons & PSP_CTRL_RIGHT) {
x+=1;
}
if(pad.Buttons & PSP_CTRL_LEFT) {
x-=1;
}
putPixelScreen(0xFFFFFFFF,x,y);
}
flipScreen();
sceKernelSleepThread();
return 0;
} |
|
|
| Back to top |
|
 |
Tinnus
Joined: 29 Jul 2006 Posts: 67
|
Posted: Sun Jun 15, 2008 12:12 am Post subject: |
|
|
Maybe you should look into SDL :) MUCH easier, and faster, than plotting one pixel at a time :)
Also, you can code and debug your game in your desktop, and just recompile & tweak for PSP later. _________________ Let's see what the PSP reserves... well, I'd say anything is better than Palm OS. |
|
| Back to top |
|
 |
^L^
Joined: 14 Jun 2008 Posts: 19
|
Posted: Sun Jun 15, 2008 4:06 am Post subject: |
|
|
| Tinnus wrote: | Maybe you should look into SDL :) MUCH easier, and faster, than plotting one pixel at a time :)
Also, you can code and debug your game in your desktop, and just recompile & tweak for PSP later. |
I've been doing it on my PSP. It's no big rush so I haven't minded.
And... I checked out SDL a while ago. I couldn't figure out how to set it up. |
|
| Back to top |
|
 |
^L^
Joined: 14 Jun 2008 Posts: 19
|
Posted: Fri Jun 20, 2008 6:54 am Post subject: |
|
|
Is bumping aloud here?
That's what this post is. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Fri Jun 20, 2008 7:26 am Post subject: |
|
|
There are plenty of PSP programs that use SDL that you can look at for how you use SDL on the PSP. There are also plenty of simple SDL examples out there that you could then try on the PSP. The only major difference between using SDL on the PC and on the PSP is the makefile.
If you google around, it's easy to find places that explain SDL... like this:
http://www.friedspace.com/cprogramming/sdlpixels.php |
|
| Back to top |
|
 |
Tinnus
Joined: 29 Jul 2006 Posts: 67
|
Posted: Fri Jun 20, 2008 7:29 am Post subject: |
|
|
Honestly, as long as you can't understand something as simple as a program framework with SDL, you won't be able to program any games more complicated than "click the red rectangle". Just go slowly and learn stuff as you go. The idea is to go from the bottom up, not the other way around. _________________ Let's see what the PSP reserves... well, I'd say anything is better than Palm OS. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Fri Jun 20, 2008 6:56 pm Post subject: |
|
|
| I don't recomend PSP's scene newcomers using libraries like SDL. That's because writing some dot to the screen could sound silly, but it's didactic, indeed. Loading and writing sprites on the screen without the knowledge of what happens behyond the scene isn't really useful. If i find it, i will post my very first approach to PSP's framebuffer... |
|
| Back to top |
|
 |
^L^
Joined: 14 Jun 2008 Posts: 19
|
Posted: Mon Jun 23, 2008 11:50 am Post subject: |
|
|
| jean wrote: | | I don't recomend PSP's scene newcomers using libraries like SDL. That's because writing some dot to the screen could sound silly, but it's didactic, indeed. Loading and writing sprites on the screen without the knowledge of what happens behyond the scene isn't really useful. If i find it, i will post my very first approach to PSP's framebuffer... |
I actually am really good with C, I just could never get the graphics.c to work with any program I made like other people could. And whenever I did, it would, the screen would flicker black and white whenever I would run the game.
| J.F. wrote: | There are plenty of PSP programs that use SDL that you can look at for how you use SDL on the PSP. There are also plenty of simple SDL examples out there that you could then try on the PSP. The only major difference between using SDL on the PC and on the PSP is the makefile.
If you google around, it's easy to find places that explain SDL... like this:
http://www.friedspace.com/cprogramming/sdlpixels.php |
And I don't know how to install the SDL. I'm sure ti would be pretty easy to use, but I'm really unfamiliar with Cyqwin and PSPToolchain and whatnot. |
|
| Back to top |
|
 |
pegasus2000
Joined: 12 Jul 2006 Posts: 160
|
Posted: Mon Jun 23, 2008 4:53 pm Post subject: Re: [C Help] Graphics Confusion |
|
|
| ^L^ wrote: | Meh...
I've tried sooo hard.
I've looked for such a long time and posted in many, many places...
I want to make a game, but I don't know how to properly display graphics on the PSP using C.
I did many tutorials, but none of them help me out with what I need.
Can someone post a sample in C for what is needed to blit a white pixel on the screen and move it around with the D-Pad using X and Y variables?
I know C very well, and I've created many text based programs. I want to take the next step and develop an actual game.
This would help me out very greatly. Thanks in advance!
^L^ |
http://visilab.unime.it/~filippo/Nanodesktop/PSP_PSPE/Docs/Docs.htm |
|
| Back to top |
|
 |
|