3DS graphical interface development

Discussion in '3DS - Homebrew Development and Emulators' started by williamdabastrd, Jan 14, 2016.

  1. williamdabastrd
    OP

    williamdabastrd GBAtemp Regular

    Member
    105
    24
    Apr 10, 2010
    United States
    Ohio
    I am currently working on some basic GUI library development and was wondering where I could see different ways to draw to the screen. Essentially, anything that has a GUI and is hosted publicly would do. Right now I have mostly looked at smealum's code.

    Essentially, the theoretical project I want to work on is a library of tools for graphical interface design on the 3DS that is reusable. A lot of homebrew applications run on text output, and having touch-enabled and user-friendly interfaces could make some tools a lot more newbie-friendly.

    Any thoughts or help is appreciated. :)
     


  2. MasterFeizz

    MasterFeizz GBAtemp Advanced Fan

    Member
    888
    827
    Oct 15, 2015
    United States
  3. Voxel

    Voxel Fable Junkie

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

    Our Patreon
    5,197
    5,888
    Jun 27, 2015
    United Kingdom
    England, UK
    Do you know how to rotate the camera in Citro3D? I'm having trouble with it, and can't seem to find a solution since there isn't much documentation/tutorials about it.
     
  4. Substance12

    Substance12 GBAtemp Advanced Fan

    Member
    562
    419
    Aug 2, 2015
    Argentina
    For 2D, sf2dlib and sfilib are the best options.
     
    williamdabastrd and Seriel like this.
  5. MasterFeizz

    MasterFeizz GBAtemp Advanced Fan

    Member
    888
    827
    Oct 15, 2015
    United States
    You need to set the view matrix according to you transformations. Sometimes the model and view matrices are combined.
     
    Voxel likes this.
  6. Voxel

    Voxel Fable Junkie

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

    Our Patreon
    5,197
    5,888
    Jun 27, 2015
    United Kingdom
    England, UK
    Hmm.. I tried that, and I can't seen to translate the camera in the right direction when I rotate it, then press up.
     
  7. Link_of_Hyrule

    Link_of_Hyrule GBAtemp Fan

    Member
    451
    133
    Jun 28, 2008
    United States
    Hyrule
    What about that homebrew grid launcher is that open source? It has a nice ui with a lot of great features.
     
  8. MasterFeizz

    MasterFeizz GBAtemp Advanced Fan

    Member
    888
    827
    Oct 15, 2015
    United States
    I've never used citro3d, but to achive what you are trying to do you have to use a "lookAt" matrix. If you just rotate and then translate, the operations are going to be done relative to the world origin(0,0) and your rotation won't be taken into account.
     
    Quantumcat and Voxel like this.
  9. daxtsu

    daxtsu GBAtemp Guru

    Member
    5,546
    3,952
    Jun 9, 2007
    Antarctica
  10. Link_of_Hyrule

    Link_of_Hyrule GBAtemp Fan

    Member
    451
    133
    Jun 28, 2008
    United States
    Hyrule
    If we can get this style in a library for all homebrew to use that would be awesome to have the tools upgraded to look better.
     
    williamdabastrd likes this.
  11. Slashcash

    Slashcash GBAtemp Fan

    Member
    334
    461
    Oct 15, 2015
    Italy
    In all honesty i wouldn't go through the framebuffer route. It would be time consuming and would require A LOT of boilerplate code. In my opinion writing some gui classes arouns sf2dlib is the route to go.
     
    clank likes this.
  12. williamdabastrd
    OP

    williamdabastrd GBAtemp Regular

    Member
    105
    24
    Apr 10, 2010
    United States
    Ohio
    So many people with helpful info! My phone died earlier so I couldn't respond.

    From what I am looking at, it seems to me that is likely the case. If I do proceed, I will likely use some combination of tools to add to any missing functionality I may want. The biggest barrier for me, in all honesty, is that I am rusty with my plain C (and C++ to a smaller extent) as opposed to C++ w/ MFC, which I use alongside C# for my job. Once I get to the point I am familiar with my options, I will certainly keep everyone updated as to my progress if I feel it is leading somewhere useful.

    This and smealum's 3ds_hb_menu is what I have been looking at so far.

    Thanks for the links, I will certainly check out my options! Hopefully I can come up with something sooner rather than later.

    (Side note: It drives me crazy that ctrulib has typedef u8 for C's uint8_t (or cstdlib std::uint8_t for C++). I am too stubborn :P)
     
    Last edited by williamdabastrd, Jan 15, 2016
    Link_of_Hyrule likes this.
  13. Slashcash

    Slashcash GBAtemp Fan

    Member
    334
    461
    Oct 15, 2015
    Italy
    Even though pure C seems a standard de facto for this community (and i really can't see why) there is no need to write a totally pure C here. The fact is that oop seems the natural route to follow for a versatile gui library but you would end up with nobody using it. XD
     
  14. williamdabastrd
    OP

    williamdabastrd GBAtemp Regular

    Member
    105
    24
    Apr 10, 2010
    United States
    Ohio
    It is my understanding that the following factors are why:
    • Embedded systems development generally uses C over C++ due to C historically having more portable compiler code, leading to smaller applications.
    • C has been a historical favorite for small communities doing the type of development done here, so a lot of it is precedent.
    • C is compatible with C and C++, whereas you have to do more work to write C++ that goes the other way, so some libraries are better off using C.
     
  15. Slashcash

    Slashcash GBAtemp Fan

    Member
    334
    461
    Oct 15, 2015
    Italy
    Well i can some valid points here. Even though i wouldn't consider 3ds as an embedded system, it has some good computational power, a fair amount of ram and a full-fledged os. And we're not developing applications where small footprint is a factor considering the average size of our sd cards.

    Anyway i don't want to start war. I was just curious about the reasons for certain trends XD
     
  16. MasterFeizz

    MasterFeizz GBAtemp Advanced Fan

    Member
    888
    827
    Oct 15, 2015
    United States
    I wouldn't call the 3ds an embedded system. Some developers prefer C over C++ for its simplicity, not only compatibility.
     
  17. williamdabastrd
    OP

    williamdabastrd GBAtemp Regular

    Member
    105
    24
    Apr 10, 2010
    United States
    Ohio
    I feel that C++ generally has a pension to overcomplicate simple problems compared to C by many developers, so I can agree with that. I personally am more familiar with OOP as a C# developer, so I lean towards C++ for that reason.
     
  18. MasterFeizz

    MasterFeizz GBAtemp Advanced Fan

    Member
    888
    827
    Oct 15, 2015
    United States
    C++ doesn't over complicate things, I would say it's the other way around. In C++, there is a lot of things happening under the hood, which makes it easier and faster to write code. In C, what you write is what you get.

    Here is Linus Torvald's rant on C++: http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918 (Strong Language Warning). I don't agree with all he says, I personally like C++ and am using it in my latest project, but he does make some good points.
     
    williamdabastrd likes this.
  19. williamdabastrd
    OP

    williamdabastrd GBAtemp Regular

    Member
    105
    24
    Apr 10, 2010
    United States
    Ohio
    I have seen that rant many times, and I actually feel the "overcomplication" I speak of isn't because the code is more complicated. It's like the famous Bjarne Stroustrup quote: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."

    Essentially, C++ has more safeguards than C, but it allows you to explicitly bypass those safeguards. When it allows you to do so, it provides no safeguards, and when things go wrong they tend to do so in spectacular fashion. This leads to weird bugs that are hard to pinpoint, whereas in C problems can be traced directly to the source more easily - C just does explicitly what you tell it to do. :)

    All in all, it's mostly just preference and a matter of how pedantic you want to get about the topic.
     
  20. SLiV3R

    SLiV3R 3DS Friend Code: 0473-9069-2206

    Member
    2,202
    1,044
    Jan 9, 2006
    Linus sounds so angry. He was more light in his biography :P