Official Colored Cube - GX2 Example

Discussion in 'Wii U - Homebrew' started by dimok, Mar 15, 2016.

  1. dimok
    OP

    dimok GBAtemp Advanced Fan

    Member
    728
    2,174
    Jan 11, 2009
    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/

    [​IMG]

    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.
     

    Attached Files:

    Last edited by dimok, Mar 15, 2016
    Gadorach, andibad, buda81 and 41 others like this.
  2. Voxel

    Voxel Fable Junkie

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,209
    5,956
    Jun 27, 2015
    United Kingdom
    England, UK
    Yes! I've been after this for ages now! :lol:
    Great work!
     
  3. Phantisy

    Phantisy Advanced Member

    Newcomer
    87
    18
    Feb 12, 2016
    United States
    Another great addition to the WiiU community by you. Thanks again!
     
  4. kprovost7314

    kprovost7314 GBAtemp's Official Bara Master

    Member
    1,713
    921
    Dec 24, 2014
    United States
    In that bara manga ( ͡° ͜ʖ ͡°)
    Nice! If only there were only a way I can program with the original Wii's GX... (No tutorials found)
     
  5. BothyBhoy

    BothyBhoy GBAtemp Advanced Fan

    Member
    836
    245
    Nov 27, 2015
    well voxel youv'e got what you required...study it well...
     
  6. OriginalHamster

    OriginalHamster UStealthy

    Member
    3,381
    642
    Nov 2, 2008
    Cote d'Ivoire
    Man you are legend from Wii days, you will missed
     
  7. oumoumad

    oumoumad GBAtemp Advanced Fan

    Member
    798
    727
    Apr 20, 2015
    France
    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 ;)
     
  8. memomo

    memomo ( ͡° ͜ʖ ͡°)

    Member
    1,072
    548
    Nov 30, 2013
    Thank you so much, we really appreciate your work and time to support our community
     
  9. Psi-hate

    Psi-hate GBATemp's Official Psi-Hater

    Member
    1,665
    1,057
    Dec 14, 2014
    United States
    Houston
    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 :)
     
  10. Voxel

    Voxel Fable Junkie

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,209
    5,956
    Jun 27, 2015
    United Kingdom
    England, UK
    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 Voxel, Mar 16, 2016
  11. roots

    roots Advanced Member

    Newcomer
    79
    33
    Nov 9, 2015
    France
    thanks a lot Dimok for this release and all your work on wiiu.
    have peace
     
  12. BothyBhoy

    BothyBhoy GBAtemp Advanced Fan

    Member
    836
    245
    Nov 27, 2015
    @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....
     
  13. Masterwin

    Masterwin GBAtemp Regular

    Member
    282
    185
    Jan 7, 2016
    Thanks @dimok for all your contributions, others follow your example now, thanks again for everything!
     
  14. Dylon99

    Dylon99 Lord of Dank

    Member
    541
    326
    Jan 12, 2016
    Netherlands
    Some cave in the mariana trench
    Thanks for all your contributions to the Wii U hacking community, I hope to see more work of you some time in the future! Take care dude :)
     
  15. 4gionz

    4gionz GBAtemp Advanced Fan

    Member
    786
    307
    Aug 16, 2014
    Canada
    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.
     
  16. Jay Clay

    Jay Clay GBAtemp Regular

    Member
    107
    43
    Jul 21, 2011
    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!.
     
  17. TiMeBoMb4u2

    TiMeBoMb4u2 GBAtemp Maniac

    Member
    1,322
    213
    Oct 25, 2008
    United States
    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.
     
  18. cebolleto

    cebolleto GBAtemp Regular

    Member
    148
    206
    Mar 5, 2010
    Quick question... how do you get shader.h from shader.frag and shader.vert? Is there a compiler or something?
     
  19. JR0DGamerz

    JR0DGamerz Member

    Newcomer
    41
    3
    Feb 3, 2016
    Canada
    This is a very good contribution!
    I love it! Great job, when I look at it, it makes me think I'm a developer.
     
  20. KiiWii

    KiiWii GBAtemp Psycho!

    Member
    3,869
    1,391
    Nov 17, 2008
    United Kingdom
    Fantastic thank you once again @dimok

    I hope we see you again around here in future!