C++


gates040

Still Fresh
Joined
Aug 13, 2007
Messages
4
Hello!
I was wondering how or what you must do to enable C++ programs to work on the gp2x. I am fully capable of programming in C++, but I do not know what type of files work an the gp2x or how to get them running. I would appreciate any help.

Thanks,
Gates040
 
Oh, and I have another question. If I created a quick game like say Pong in a program like Game Maker, would I be able to make the executable file, .exe, work on the gp2x?

Thanks,
Gates040
 
C++ is fine; ie: Youi're still just using g++ (gcc) and likely SDL from the sounds of it.

As to GM, cxheck the GM site. But apparently so.

jeff
 
So the gp2x can run c++ files and .exe files without any conversion?

-Gates040
 
No offense, but if you don't already understand this I doubt you know C++ or any C at all. Or any language that require compilation. I mean, you refer to binaries as .exe files which implies you've never realised there is anything out there outside windows.
 
well he's probably taking a class in c or c++.

Processor architectures differ and in order for a program to work on one, among other things, it has to be compiled and/or assembled specifically for the intended target.

One benefit of C is that, since it is a compiled language, you can write for as many platforms as there exist C compilers.

So your goal is not to convert programs compiled for PC to ones for GP2X, but to compile them for GP2X. It's not complicated though.

You need a working toolchain -- one of which is linked above -- that will compile your C programs for the gp2x. I don't know what compiler you're using for C++ (maybe VS or .NET?) but I think most gp2x work is done with gcc-arm.

If your program contains Windows-specific code (ie if you're using the Windows Platform SDK), it has to come out. In its place you have libraries like SDL and Ryleh's minimal lib that do things like reading joystick presses and access the screen.

Standard output on the gp2x goes to the terminal, which you can log into over USB, using telnet.

Based on what I've read, it will probably be easier to set up a new devkit using either Codeblocks or Devc++ than to screw around with a VS setup, if that's what you have. But anyway if you can code then you're most of the way there, you just need to research build environments...how the compiler works...all that jazz.

Game Maker is another beast entirely, and one which I don't know enough about to comment on. I know that there are products like it that will let you make GP2X programs. But if you know any C then that is by far your best bet. Just have to plow through some SDL tutorials if you haven't already. Also, Fenix might be up your alley, it's more in the style of a BASIC, with some neat features that make it very suitable for game programming. But not super useful outside the GP** scene.

Good luck.
 
Thanks rokdcasbah! What you said was exactly what I was looking for.

For sam fisher, I dont have a gp2x yet. I was unsure on where/what the compiler was for gp2x, because I must have missed it in the downloads. And for your assumptions about my programming skills, I am a junior in high school. I have taken several classes since middle school, and I can program in java, c++, and visual basic.

But, again, thanks rokdcasbah.

-Gates040
 
gates040 said:
Thanks rokdcasbah! What you said was exactly what I was looking for.

For sam fisher, I dont have a gp2x yet. I was unsure on where/what the compiler was for gp2x, because I must have missed it in the downloads. And for your assumptions about my programming skills, I am a junior in high school. I have taken several classes since middle school, and I can program in java, c++, and visual basic.

But, again, thanks rokdcasbah.

-Gates040
There is also 'sdlBasic' and GLBasic (the latter of which creates GP2X binaries) if knocking up quick games is your bag. Oh, and don't worry about Sam Fisher, he's a tosser. He's on my ignore list but I'm sure his post is just a waste of space, check his history.
 
Last edited by a moderator:
haha ur pwned sam srslyz!!11

nah, sam's a cool guy. unlike me...i am nice to people on the boards but in real life i am the foreman at a factory that makes hamburgers out of kittens.

gates, if you are interested in buying / programming for the gp2x, you should probably dig into SDL a bit if you haven't already. then, once you have the unit, you just have to port from one sdl platform to another, which is super easy, especially since it's your own code.

there are differences to consider, like the fact that heavy use of floating point and trig functions is right out, and you need to find mathematically equivalent or approximate ways of doing those things.

there is a new system being designed that, if everything goes according to plan, could be out next year. but i'd be extremely surprised if sdl wasn't one of the first things people tried to get going on it. so game coding in sdl is a good skill to have, and the gp2x is enjoyable enough imo that you should just get one rather than wait.
 
gates040 said:
Thanks rokdcasbah! What you said was exactly what I was looking for.

For sam fisher, I dont have a gp2x yet. I was unsure on where/what the compiler was for gp2x, because I must have missed it in the downloads. And for your assumptions about my programming skills, I am a junior in high school. I have taken several classes since middle school, and I can program in java, c++, and visual basic.

But, again, thanks rokdcasbah.

-Gates040
Sorry for being harsh. I am very sure you know more about actualy programming than me, I suck considerably at C and C++ I really know nothing about :S. I was just confused by your original statement about running windows x86 binaries on an ARM build of linux.
 
Last edited by a moderator:
Game maker is ONLY for windows, unless your able to hack the program, make another compiler that will convert the editables (aka the .gmk files) and compile them (which if it was easy, yoyo games or mark would of already done it by now), or you could make windows emulator on it or possibly install windows on. Anyways these probably won't happen so for know game maker is only for windows.
 
Kicy said:
Game maker is ONLY for windows, unless your able to hack the program, make another compiler that will convert the editables (aka the .gmk files) and compile them (which if it was easy, yoyo games or mark would of already done it by now), or you could make windows emulator on it or possibly install windows on. Anyways these probably won't happen so for know game maker is only for windows.
There's a similar piece of software available though. :)
 
Last edited by a moderator:
Actually, Game Maker/GML is an interpreted language and thus if an interpreter were made for the gp2x, it could be done. The chances are so unlikely that it's best left alone anyway, though.
 
P-J said:
There is also 'sdlBasic' and GLBasic (the latter of which creates GP2X binaries) if knocking up quick games is your bag. Oh, and don't worry about Sam Fisher, he's a tosser. He's on my ignore list but I'm sure his post is just a waste of space, check his history.
Hi, and sorry for resurrecting an old thread :)
I've started to learn Python months (years ?) ago, but now I realize that this is not the best language when dealing with the GP2X. I had a quick look today at the GP2X wiki and found some information about sdlBasic, which seems to be a good language to learn for me, who have little coding background.
Being an Ubuntu user, I've downloaded and installed the sdlBasic *.deb package, along with some coloration mode for gedit and some gp2x specific bindings. As you can imagine I've also downloaded sdlBasic for GP2X.
I hope I did things the right way...I've tested some demos and games on the GP2X, and almost everything works fine, but slowly. I will now dive into tutorials and documentation. I do recommend this language to all the beginners who are willing to contribute something to the GP2X but lack coding experience :)
Bye, Magic Sam
 
Last edited by a moderator:
Back
Top