Some questions about development for the 3DS

MasterMan194

Well-Known Member
OP
Member
Joined
Dec 30, 2008
Messages
125
Trophies
1
XP
414
Country
Brazil
Hello. First of all, know that I'm not a programmer, I'm more of a programming enthusiast. Yesterday I prepared the environment and managed to compile the hello-world example. I have a little knowledge in PHP, JavaScript, Java and flutter. Generally OO languages.

* How to build a Makefile for my C++ app to compile with devkitARM?
* Can I use OOP with C++ on devkitARM or just structured programming?
* Is there any library for creating/reusing widgets (text boxes, buttons...)?
* And also can someone point me to a good tutorial for 3DS development? I was using the tutorial at https://github.com/xem/3DShomebrew/wiki, but as in the first line "Warning: This whole tutorial is very old and outdated!!".
 
  • Like
Reactions: Technicmaster0

Technicmaster0

Well-Known Member
Member
Joined
Oct 22, 2011
Messages
4,406
Trophies
2
Website
www.flashkarten.tk
XP
3,497
Country
Gambia, The
Hello. First of all, know that I'm not a programmer, I'm more of a programming enthusiast. Yesterday I prepared the environment and managed to compile the hello-world example. I have a little knowledge in PHP, JavaScript, Java and flutter. Generally OO languages.

* How to build a Makefile for my C++ app to compile with devkitARM?
* Can I use OOP with C++ on devkitARM or just structured programming?
* Is there any library for creating/reusing widgets (text boxes, buttons...)?
* And also can someone point me to a good tutorial for 3DS development? I was using the tutorial at https://github.com/xem/3DShomebrew/wiki, but as in the first line "Warning: This whole tutorial is very old and outdated!!".
For the first question, I'd see if I can find another makefile that uses C++ and simply copy it. At least for the beginning. Afterwards you can compare them and learn from that. That's basically how 3DS development works. There is close to no documentation apart from existing projects and devkitpro examples (and ofc devkitpro sourcecode. Sometimes it's good to take a look at the source to understand how things work).
For graphical stuff, there might be a SDL/SDL2 port for the 3DS that can be installed via portlibs. I'm not sure if there is anything beyond that. You might take a look at other examples and see which libs they use.
Maybe other people can give better answers tho. It's been a while since I took a look at the 3DS development stuff.
 

TheStonedModder

Well-Known Member
Member
Joined
Dec 25, 2022
Messages
824
Trophies
0
Age
27
XP
1,628
Country
United States
For the first question, I'd see if I can find another makefile that uses C++ and simply copy it. At least for the beginning. Afterwards you can compare them and learn from that. That's basically how 3DS development works. There is close to no documentation apart from existing projects and devkitpro examples (and ofc devkitpro sourcecode. Sometimes it's good to take a look at the source to understand how things work).
For graphical stuff, there might be a SDL/SDL2 port for the 3DS that can be installed via portlibs. I'm not sure if there is anything beyond that. You might take a look at other examples and see which libs they use.
Maybe other people can give better answers tho. It's been a while since I took a look at the 3DS development stuff.
OP would be better off straight learning C first

Those Devkit pro examples suck and are useless to someone trying to learn. It took me days getting their SDL2 example thanks to vauge ungoogleable errors that meant I was missing dependencies

I'm sure making something like devkitpro isn't easy but its not learner friendly at all and makes TONS of assumptions
 

MasterMan194

Well-Known Member
OP
Member
Joined
Dec 30, 2008
Messages
125
Trophies
1
XP
414
Country
Brazil
OP would be better off straight learning C first

Those Devkit pro examples suck and are useless to someone trying to learn. It took me days getting their SDL2 example thanks to vauge ungoogleable errors that meant I was missing dependencies

I'm sure making something like devkitpro isn't easy but its not learner frien.dly at all and makes TONS of assumptions
I did C in the begining of my graduation in system analisis, in the programation logics discipline. 12 years ago. After that was Java till the end. PHP and others, i did for fun. C++ i've started last week.
 

Coderman64

Member
Newcomer
Joined
Feb 18, 2024
Messages
20
Trophies
0
XP
90
Country
United States
1. The best idea for starting out is to use one of the libctru examples as a starting point, and modify the makefile as needed. I believe they are set up to compile cpp files with g++ for all source files that end with ".cpp". Once you get into it, and understand the build process a little more, you might be better able to write a makefile yourself.

2. C++ on devkitarm (and everywhere) does support OOP, but it is a bit different and more complex than languages like Java and C#. For example, unlike in Java and C#, there is no garbage collector, meaning you have to ensure the memory you allocate is properly freed once you're done with it. I'd usually recommend getting started on a desktop computer, as it is much easier to debug that way, but I understand that being less exciting than running it on a Nintendo handheld. ;-)

Also, cppreference dot com is your friend.

3. Personally, I have never used any on the 3ds, but there are some ports of ImGui (short for "immediate mode GUI"), which provides some widget functionality for immediate graphics environments, like SDL, OpenGL, and (in this case) the 3ds. (Since I can't post links yet, just search for "ImGUI 3ds").

4. There aren't really a lot of good tutorials for this. I've learned mostly through trial and error (and knowing a good bit of stuff about C/C++ before hand). The example projects are a decent enough place to start.

another good thing to do is to get used to using GDB for debugging. There is plenty of information about GDB in general, though 3ds-specific stuff is harder to find. It can be used to step through and debug applications both in Citra and on modded hardware, making it a lot easier to understand where bugs are happening.

Overall, the 3DS is kind of a bad place to start learning C++, but if you can get through it, you'll learn a lot of very marketable programming skills. ;-)
 
  • Like
Reactions: Deepdive543443

Deepdive543443

New Member
Newbie
Joined
Oct 25, 2023
Messages
3
Trophies
0
Age
23
XP
40
Country
China
The Makefile provided by Hello World example could be used on C++ project as well. It has rules for g++ and I have a few projects built on it. For UI library, I was using LVGL for UI. It looks good and it’s a pure C library, but I‘m still looking into how to make it get used with GPU rendering. I also found homebrew that built on ImGui(FTPD Pro, and maybe more).

There isn’t too many tutorials out there, my approach is looking at Libctru’s documentation, the 3DS Homebrew SDL and it’s well documented. If you find others Homebrew implemented features that you’re interested in, might be good to check out their source code as well.

Hope you enjoy your time playing with Homebrew, I was picking up C/C++ because of 3DS Homebrew as well and it’s an amazing journey:)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Lol rappers still promoting crypto