AnacronPhoenix
Posts: 6
Joined: Thu Jan 31, 2013 9:04 am

C++ & OpenGl

Thu Jan 31, 2013 9:26 am

Hello guys my name is Argy and i am so new in raspberry that i think that i must evaluate all my knowledge that i have achieved so far, not only in Linux but in computers in general...
I know the difference between ARM and AMD/Intel(32/65bit) processors but i have some questions...

1]Can i program in C++ in raspberry? (i believe yes)
2]Can i program in OpenGl in raspberry? (i really don'e know)
3]The code that i will compile (build, run and save) in raspberry can in some way be build as an executable (.exe) file or something that i can run in AMD/Intel(32/64bit) processors?
4]If the 3nd is yes does that mean that i can program for XBoxLiveArcade?
5]If the 3nd is no does that mean that i can only program for ARM devices as such (raspberry/android/ios...etc)?

I really need your help guys cause i am running out of time...!!!

Thank you in promo just for your time to read it...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23980
Joined: Sat Jul 30, 2011 7:41 pm

Re: C++ & OpenGl

Thu Jan 31, 2013 9:35 am

AnacronPhoenix wrote:Hello guys my name is Argy and i am so new in raspberry that i think that i must evaluate all my knowledge that i have achieved so far, not only in Linux but in computers in general...
I know the difference between ARM and AMD/Intel(32/65bit) processors but i have some questions...

1]Can i program in C++ in raspberry? (i believe yes)
2]Can i program in OpenGl in raspberry? (i really don'e know)
3]The code that i will compile (build, run and save) in raspberry can in some way be build as an executable (.exe) file or something that i can run in AMD/Intel(32/64bit) processors?
4]If the 3nd is yes does that mean that i can program for XBoxLiveArcade?
5]If the 3nd is no does that mean that i can only program for ARM devices as such (raspberry/android/ios...etc)?

I really need your help guys cause i am running out of time...!!!

Thank you in promo just for your time to read it...
1) Yes.
2) We have libraries for OpenGL ES 2.0, OpenVG, OpenMAX, EGL.
3) Whilst it is possible to install a cross compiler so that code can be built on the (Arm based) Raspberry to run on a x86 processor, I'm not sure anyone has ever bothered to do it., Usually its much quicker to run the compiler on the x86. it would also be a very slow compile.
4) No idea.
5) See 3)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

AnacronPhoenix
Posts: 6
Joined: Thu Jan 31, 2013 9:04 am

Re: C++ & OpenGl

Thu Jan 31, 2013 11:12 am

Thank you very much for the quick reply...
I am an indie developer, i want to use raspberry to make my retro_style_games, available both in windows bun in linux too...

techs1200
Posts: 28
Joined: Thu Jan 24, 2013 7:45 pm

Re: C++ & OpenGl

Fri Feb 08, 2013 3:47 pm

Xbox live arcade games are not written in OpenGL. Why? Because MS are evil bastards, thats why...

If you use OpenGL your game can theoretically run on

-Windows
-Linux (including raspberry pi)
-Mac OSX
-iOS
-Android
-Ouya game console (hell its just android inside...)

As long as you don't use newer features found in desktop GL you should be fine.

OpenGL ES2 and OpenGL 2 (desktop) are basically the same as long as you don't use the fixed function pipeline of desktop GL. I'm sure I will get flamed for that last sentence, but at a high level they are very similar. Force yourself to write shaders instead of the fixed function pipeline.

In other words, it is much easier to port OpenGL ES2 ==> Desktop OpenGL2 than the other way around.

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: C++ & OpenGl

Mon Feb 25, 2013 3:29 pm

jamesh wrote:
AnacronPhoenix wrote:Hello guys my name is Argy and i am so new in raspberry that i think that i must evaluate all my knowledge that i have achieved so far, not only in Linux but in computers in general...
I know the difference between ARM and AMD/Intel(32/65bit) processors but i have some questions...

1]Can i program in C++ in raspberry? (i believe yes)
2]Can i program in OpenGl in raspberry? (i really don'e know)
3]The code that i will compile (build, run and save) in raspberry can in some way be build as an executable (.exe) file or something that i can run in AMD/Intel(32/64bit) processors?
4]If the 3nd is yes does that mean that i can program for XBoxLiveArcade?
5]If the 3nd is no does that mean that i can only program for ARM devices as such (raspberry/android/ios...etc)?

I really need your help guys cause i am running out of time...!!!

Thank you in promo just for your time to read it...
1) Yes.
2) We have libraries for OpenGL ES 2.0, OpenVG, OpenMAX, EGL.
3) Whilst it is possible to install a cross compiler so that code can be built on the (Arm based) Raspberry to run on a x86 processor, I'm not sure anyone has ever bothered to do it., Usually its much quicker to run the compiler on the x86. it would also be a very slow compile.
4) No idea.
5) See 3)
1, 2 already answered.

3, Yes. There are several Opengl ES SDK available for desktop. the Mali SDK in particular provides cross platform sample code that builds for windows and linux. I was using this, but as the Mali SDK emulates OpenGL ES using Mesa in software it was a bit slow. I'm now using the AMD native implementation and have also fashioned my own stuff to also build for Desktop GL. So I can build exe's for windows that use OpenGL ES / EGL or Desktop OpenGL + wglXX (provided by wingdi), and i know that I can easily port my stuff to Linux once I have something worthwhile done.

The only problem i had was a difference in the implementaton of eglgetconfig between the mali and amd versions.

4. not directly, you might be able to leverage the ANGLE project (which provides opengl es over directx) to do that but it'd probably need some work (ANGLE is the webgl backend that chrome and firefox use to translate webgl which is almost the same as OpenGL ES to directx)

5 see 3
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

dextrus
Posts: 119
Joined: Tue Jan 24, 2012 10:10 pm
Location: Eastleigh, Hampshire
Contact: Website

Re: C++ & OpenGl

Mon Feb 25, 2013 3:50 pm

By "XBoxLiveArcade", I'm assuming you mean XNA? There is a thing called MonoGame which is attempting to be a cross-platform version that uses OpenGL I believe and has had some success and does work on the Pi.

/Dextrus
Have more FUN with your Pi. Visit www.pi-fun.com

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: C++ & OpenGl

Mon Feb 25, 2013 4:14 pm

is direct3d the graphics part of xna? not sure how it all works these days
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

Return to “Graphics programming”