RELEASE CustomUI - C++ libnx libs for creating switch-like UI homebrew apps!

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by XorTroll, Jul 18, 2018.

  1. XorTroll
    OP

    XorTroll Dev: Goldleaf, emuiibo, Brew.js...

    Member
    11
    Dec 28, 2017
    Spain
    Nowhere
    Hi again!
    I've developed these libs based on the source of various apps I have like NXPlay or eNXhop.

    They're pretty easy to use, and customizable.

    GitHub repos: https://github.com/XorTroll/CustomUI
    Releases: https://github.com/XorTroll/CustomUI/releases/latest

    How can I use them?
    • The libs are only one header file, so it's easy to embed.
    • For using default themeing (HorizonDark and HorizonLight) you'll have to add some files and folders to romfs to your project ("Graphics" and "Fonts")
    • You'll need SDL2 libs, check sample's Makefile for more info about required libs, as the UI is rendered using SDL2.
    • For those who used NXplay, this libs are based on it's code
    Enjoy coding pretty Horizon UIs!

    2018071821394800-DB1426D1DFD034027CECDE9C2DD914B8.

    2018071821395500-DB1426D1DFD034027CECDE9C2DD914B8.
     
    Last edited by XorTroll, Jul 18, 2018
  2. EmperorX

    EmperorX GBAtemp Regular

    Member
    5
    May 15, 2012
    Lebanon
    Damn! You're on a roll @XorTroll . Thanks for all of your work!
     
  3. jjbredesen

    jjbredesen Yes I am not dead.

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

    Our Patreon
    Feb 16, 2018
    Korea, North
    Hyrule
    At this rate @XorTroll needs his own release subforum lol, great work!
     
    EmperorX likes this.
  4. XorTroll
    OP

    XorTroll Dev: Goldleaf, emuiibo, Brew.js...

    Member
    11
    Dec 28, 2017
    Spain
    Nowhere
    I had some projects to publish, but I also had too many ideas!
     
    Armen, Jay Griggs and EmperorX like this.
  5. Thetoto

    Thetoto GBAtemp Advanced Fan

    Member
    5
    May 10, 2018
    France
    So Nice ! Thanks à lot
     
  6. DrFizzles

    DrFizzles Member

    Newcomer
    1
    Jun 6, 2018
    United States
    What OS do you use to compile this? Tried on MacOS 10.13.5 and kept getting SDL2/SDL.h: No such file or directory error. Even after installing SDL2.
     
  7. machine69_420

    machine69_420 Member

    Newcomer
    3
    May 15, 2018
    Czech Republic
    Have you actually linked the SDL2 library in your make file?
     
    Last edited by machine69_420, Jul 20, 2018
  8. DrFizzles

    DrFizzles Member

    Newcomer
    1
    Jun 6, 2018
    United States
    I tried compiling the example from the repository and was getting that error. I assumed that Makefile was ready to go.

    Here is the 'options' portion of the Makefile from the Repository.

    Code:
    #---------------------------------------------------------------------------------
    # options for code generation
    #---------------------------------------------------------------------------------
    ARCH    :=    -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
    
    CFLAGS    :=    -g -W -O2 -fpermissive -ffunction-sections \
                $(ARCH) $(DEFINES)
    
    CFLAGS    +=    $(INCLUDE) -D__SWITCH__
    
    CXXFLAGS    := $(CFLAGS) -fno-exceptions -std=c++11
    
    ASFLAGS    :=    -g $(ARCH)
    LDFLAGS    =    -specs=${DEVKITPRO}/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
    
    LIBS    := -lfreetype -lSDL2_mixer -lmodplug -lmpg123 -lvorbisidec -logg -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lpng -ljpeg `sdl2-config --libs` `freetype-config --libs` -lnx
     
  9. machine69_420

    machine69_420 Member

    Newcomer
    3
    May 15, 2018
    Czech Republic
    I see... well I am on mac too and the example compiles just fine for me, so there must be smth wrong with your pacman SDL2 library
     
  10. DrFizzles

    DrFizzles Member

    Newcomer
    1
    Jun 6, 2018
    United States
    Hmmm. Where/how did you install SDL2? I downloaded the DMG from here (Tried both libraries). When I ran the DMG it gave me an SDL2.framework file and all the readme said was to put it in /Library/Frameworks/ so I did.

    Tried restarting my machine as well and installed any updates but still no dice.
     
  11. ShroomKing

    ShroomKing Mr. Nice ( ͡° ͜ʖ ͡°)

    Member
    5
    Mar 3, 2017
    United States
    in bed
    You need to use the switch port of SDL2.
    Also i'm not familiar with macOS, but it's Unix so i'm pretty sure you need to put the library & headers into the devkitA64 lib & include directories.

    Again, i never really used macOS so i might be wrong. Feel free to correct me.
     
  12. machine69_420

    machine69_420 Member

    Newcomer
    3
    May 15, 2018
    Czech Republic
    Yep @ShroomKing is right.

    The easiest way to get switch port of SDL2 is to install dkp-pacman which is package manager for devkitpro: https://github.com/devkitPro/pacman/releases

    To quote pacman wiki how to use this:

    To list packages use `dkp-pacman -Sl`
    To install a package use `sudo dkp-pacman -S <name of package>`
    `sudo dkp-pacman -R <name of package>` will remove an already installed package.
     
  13. DrFizzles

    DrFizzles Member

    Newcomer
    1
    Jun 6, 2018
    United States
    ShroomKing was right about the switch port of SDL2, and using dkp-pacman was the way to do it. I didn't know that I had to install it that way (the readme for CustomUI just says to install SDL2 with no specifications or directions).

    Got the SDL2 libs installed properly and was able to successfully build. Thanks guys!
     
  14. dj_skual

    dj_skual Code & Mix

    Member
    6
    Mar 9, 2008
    France
    can someone point me to a compiled version of sdl2 for Windows 10 and explain me how to install?
     
  15. Kevoot

    Kevoot Advanced Member

    Newcomer
    4
    May 23, 2018
    United States
    Oh good, time to nuke LaiNES UI in favor of this. Good work.
     
    SpaceJump likes this.
  16. machine69_420

    machine69_420 Member

    Newcomer
    3
    May 15, 2018
    Czech Republic
    Go ahead and download devkitpro updater: https://github.com/devkitPro/installer/releases/tag/v3.0.3

    Run it and let it do it's thing (it will install and upgrade all necessary packages for devkitpro).

    In start menu you should now see devkitPro folder and inside is Msys2 which is special command tool for devkitPro. Run it.

    If you then run in the console command: "pacman -Sl" it will list all available packages and shows which ones you installed (there you should find names of all sdl2 packages).

    To install the package run: "pacman -S <name of the package>". So smth like: "pacman -S switch-sdl2" should install the base of the sdl2 library.

    And boom you should have working sdl2 library.
     
    Last edited by machine69_420, Jul 20, 2018
    lordelan, DarkUnixOs and dj_skual like this.
  17. relative

    relative Newbie

    Newcomer
    1
    Jun 15, 2018
    United States
    I made something like this but was not able to post it (and still am unable to) because i am a new member. gitlab dot com /precisionui/precisionui
     
  18. XorTroll
    OP

    XorTroll Dev: Goldleaf, emuiibo, Brew.js...

    Member
    11
    Dec 28, 2017
    Spain
    Nowhere
    We could merge our libs, lemme take a look
     
    lordelan and relative like this.
  19. Kevoot

    Kevoot Advanced Member

    Newcomer
    4
    May 23, 2018
    United States
    @XorTroll I may submit a PR, it's a good start but there are definitely some issues. If the UI inits all the SDL portions for you it should certainly take in some params for configuration. Additionally there should be some function for returning the window/renderer objects for use after init through the rest of the application and right now it lacks that functionality.
     
  20. XorTroll
    OP

    XorTroll Dev: Goldleaf, emuiibo, Brew.js...

    Member
    11
    Dec 28, 2017
    Spain
    Nowhere
    Be free to submit it, it's just a very early release,more stuff is planned
     
    Last edited by XorTroll, Jul 22, 2018
    Kevoot likes this.
  21. Kevoot

    Kevoot Advanced Member

    Newcomer
    4
    May 23, 2018
    United States
    Kind of figured, once I get Laines running with it I'll clean up my modifications and submit and we can go from there.
     
Loading...