Homebrew Official Colored Cube - GX2 Example

  • Thread starter Thread starter dimok
  • Start date Start date
  • Views Views 10,068
  • Replies Replies 25
  • Likes Likes 45

dimok

Well-Known Member
Member
Joined
Jan 11, 2009
Messages
728
Reaction score
2,193
Trophies
3
XP
2,665
Country
United States
Hello everyone,

as announced and wanted by several people here is a small colored cube example written in plain C which shall demonstrate the use of the WiiU GX2 engine. Basically it shows a colored cube made out of triangle primitives that is rotating. Out of convinience I used GLM library as the math library for matrix/vector calculations. It's a C++ library which is why I wrote a few wrapper functions around the calls to GLM so people can easily switch to an equivalent C math library if they want.

For this GX2 example I used the following OpenGL tutorial's example as a base:
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-4-a-colored-cube/

cube.png


I tried to keep almost all parts as close as possible to the original example and as simple as possible. With this you have a compare of how GX2 works to OpenGL and a documentation of the example on what is going on in it. The only changes/additions I did to this example are the following:
- added automatic cube rotation (initially)
- added gamepad D-PAD controls to rotate the cube manually
- changed aspect ratio to 16:9 instead of 4:3

That's all. Everything else is basically the same. Even the GLSL shader code is the same as in the original example. This is probably also the minimal setup you will need to use GX2. Please don't take this as the cleanest example or the "best practice" example. It's not. It should just show the basic mechanics.

This application is written for HBL v1.1.

You can find the original source code for OpenGL at this link:
http://www.opengl-tutorial.org/download/ (normal version)

Well as already mentioned on the ddd thread this is my last contribution to the WiiU (at least for a while). I am not sure when I will have time again to actually start new projects but I dont think it will happen anywhere before the end of the summer if at all. So thanks again to everyone who supported me and my applications! I hope with this last addition there will be more homebrews or games using the GX2 engine coming up in the near future.
 

Attachments

Last edited by dimok,
You've done amazing work in the scene Dimok, we would never get this far today without you ^^,
I wish you luck in your life ;)
 
Thank you so much, we really appreciate your work and time to support our community
 
I'm learning C so maybe in a few days, I'll know enough to look at this code and comprehend some of it! Thanks :)
 
huh? o.O

I thought this would be working in 5.5? I just tried the elf file out in the 5.5 elf loader, but it doesn't seem to work. :unsure:
Was the elf just designed for 5.3.2/5.4.0? Or can it work for 5.5 users too? Surely it can work since it doesn't require kernel, and GX2 functions can be used in usermode...


EDIT: Nevermind, I saw os_defs.h and found some kernel-related code. :(
 
Last edited by ,
@dimok did say he wd help folk with any problems they have using his software, or for new devs who wanted to use the loadiine engine....he will pop in from time to time but has private projects and wife n family to take care of so....
 
Wow I remember seeing dimok in the wii scene when I was still just a lurker..sucks to see you go and really hope you come back eventually since this scene is seriously lacking in devs, especially devs who are willing to release and break barriers like you did.
 
You sir are a legend and one of the few programers who contribute to the wii U scene without the need of fame or create any unnecessary hype, from the wii to the wii U scene, we salute you, and thank you for your hard work so more people can use your tools, I think more people should learn from you, thank you!.
 
Happy that you stayed as long as you did!
Sorry to see you go, but wish you the best!
Here's hoping that someone will start investigating that symlink/mount point that has exploit potential.
 
Quick question... how do you get shader.h from shader.frag and shader.vert? Is there a compiler or something?
 
This is a very good contribution!
I love it! Great job, when I look at it, it makes me think I'm a developer.
 

Site & Scene News

Popular threads in this forum