I Suck And Need Help... Sdl... (help Here)


Nmn

Still Fresh
Joined
Dec 27, 2005
Messages
80
I suck, cannot find a start, or example, for C. Maybe im just slow, but i know basically how to use SDL but i dont know how to start on the GP2X.

Is it normal? If so, i feel like a fucking retard.

Either way, a better start would help anyways.
 
Ok, I got my GP2X in time for Christmas but couldn't for the life of me get it to do a damn thing. I have been reading posts here for answers and it seemed to be the fact that I didn't have a SD 1mb card. Either that or the USB cable was faultly. So I ordered an SD card and it arrived today and guess what... I am still not getting anywhere. Is it possible for someone to post a copy of how to use the GP2X on this web-site? I don't have a clue how to get the cd that came with my console onto the console itself. I got it on my computer (which runs Windows XP Home) and unzipped it etc. but now what?
 
...and now I've gone and posted in the wrong place. Damn! Can I do ANYthing right? :(
 
My advice:

Buy a card reader at your local store(one supporting sd/ secure digital cards)

Buy a sd/secure digital CARD(May i suggest a sandisk 512mb card?)
EDIT: PLUG IN YOUR CARD READER WITH SD CARD IN


Press Start, My computer

Right click the drive that says something like "removable drive"

Press format

Press Ok

Double click the removable drive

Load any piece of software or media and see if it works right

Post a new topic before messing up mine :(
 
Yeah, I would also like to find some kind of tutorial specificly for the GP2X.

I'm fluent in VB6, VB.NET, PHP, Scheme,... but I know nothing about C and the SDL libraries.

If someone that understood SDL would write a small tutorial I would be sooooo happy.

I need some basic stuff, like how to load a sprite into the memory, how to display it, how to make it transparant,double buffering, ...

Reinout,
 
I can handle some C and lots o C++...

@peanutman: try some existing C, C++ tuts first.

But its been a year since i've touched sdl, and i dont know if coding in GP2X SDL is about the same as c++. Ill search around.
 
Ok... Now i have another prob. Found an example, thanks to the GP2X Wiki.

Can you help me fix the errors? ive been at it for a while and still cannot see the problem.

http://img398.imageshack.us/img398/3193/sdl3yf.png

Using DevCpp

My linker settings:
libSDLmain.a
libSDL.a
libSDL.dll.a

The dev kit compiler, and i really hope for help.:mellow:
 
peanutman, trust me VB6 can only be a hindrance to this (as I have found :( )

PHP is somewhat helpful, as they share some commands, but C makes everything wayyyy more complex than PHP.

I'm around the same stage as you, although I have used C before (it was 2 years ago though so I've forgotten a lot.) Would really appreciate if someone did a sprites etc tutorial, but I'm fairly certain it's exactly the same as SDL, so just use an SDL tutorial on sprites.

I would also really, really appreciate if someone did a 'how to get GP2X input with SDL' example, because the example on the wiki doesn't work for me at all.
 
Nmn,

Im now getting DevCpp setup on my machine I got fed up with using MS VisualCPP.. I kept getting unexpected blue screen of death.

Anyway.. The only way I can get a clean compile with DevCPP is to set the flag to make it use my own makefile which I created using the sdltest makefile as the template.

My next step is to try and install SDL on my machine and get DevCPP setup so when I use the default compiler settings it will compile my code to run in windows.

I must say with the limited time I get to play around this is taking me much longer than I had hoped but Im sure it will all be worth it :)
 
Im working on a port of SDL_Jump, and in the sdljump.h, it defines the controls like so:
#define KEY_LEFT1 SDLK_LEFT

can I leave it like that or do I have to put something like:
#define KEY_LEFT1 GP2X_BUTTON__LEFT

or something like

#define KEY_LEFT1 (2)

or maybe something completely different?
 
Im working on a port of SDL_Jump, and in the sdljump.h, it defines the controls like so:
#define KEY_LEFT1 SDLK_LEFT

can I leave it like that or do I have to put something like:
#define KEY_LEFT1 GP2X_BUTTON__LEFT

or something like

#define KEY_LEFT1 (2)

or maybe something completely different?

Hi!
I'm the Sdljump author and I'm very glad to see someone porting it to gp2x (I found this thread googling randomly :p). Actually, I've got a friend who has a gp2x and I had in mind to port Sdljump to gp2x in the future, but I'm having less time to code than I expected and so ew releases of Sdljump are being delayed.

I have just foudn two interesting links that might help you in porting sdljump to gp2x:
http://wiki.gp2x.org/wiki/SDL_Joystick_mapping
http://wiki.gp2x.org/wiki/SDL_FAQ

Answering to your question, it is not completly different but it is quite different. Changing that part of the code would be ok (preferably use an #ifdef GP2X to make things clearer and easier). But you would also have to change a pair of functions to make things work, as the input events are SDL_JOYBUTTONUP(DOWN) insteand of SDL_KEYDOWN(UP) event. That would be easy to change actually.

However, there are still two more aspects that would make the port a little (just a little :p) harder.

A. AFAIK, Gp2x does not support OpenGL so you would have to strip out the Opengl part of the code. I would not be very hard, just delete the sdl_gl2d.c/h files and delete all the calls to GL2D_* alike functions in surface.c. Delete the #includes to any opengl stuff and fix a pair of things and its done.

B. GP2x only supports 320x240. That is a problem as the screen resolution depends on the theme file (as you might have noticed, the xjump and auri themes use different sizes). You might think that designing a new sking for 320x240 would be enough, but that is not possible as the brick size is 16x16 and the grid size is 24x32. In the future, in order to solve this, I'll include variable brick size.

After 0.92 (which, sadly, will not include all the features promised at the webpage), I'll work on the port so, if you don't want to do all the work by yourself you can just wait until I have to time to do it :p

Bie!
 
Last edited by a moderator:
Back
Top