Author Topic: 2D vs 3D GUI desktop  (Read 8257 times)

0 Members and 1 Guest are viewing this topic.

Offline MachManX

  • 26
  • The Fight Never Ends...This Is A Fact Of Life!
When you play a game the computer essentially uses a 3D mode to run the game like DirectX or OpenGL.  When you go back to the desktop it goes back to 2D mode.  There are other devices out there that use similar techniques like Android, etc.  I guess the point of switching to a 2D mode is to save power, unless there's something more?  I find it interesting that game GUIs are much smoother and respond faster than say the start menu of Windows XP...sometimes there are occasional delays.  I guess what I'm trying to ask is would a 3D GUI interface be better than our traditional 2D interfaces in terms of responsiveness?  How bout from a programmer's perspective?

My knowledge only extends to C++ object-oriented programming, which I completed last semester.  So sorry if this is a weird question.  I'm thinking about whether I should learn about 3D programming if I want to build an interface, like a frontend for a program, or if I don't have to go that far and just learn 2D stuff.  Let's say for example I wanted to develop a smooth but graphical media player interface for Windows or Android.  Currently leaning towards Android though.
AMD Ryzen 5 3600
B450I GAMING PLUS AC
Geforce GTX 1060 6GB
16GB DDR4-3600
WD SN750 1TB NVME
Samsung 850 EVO 250GB SSD
Corsair HX520W PSU
Cougar QBX Case
NEC V422 42" @ 1080p
Ubuntu 20.04 + Whatever I VM

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
All Windows interfaces after Vista are running on the GPU. Linux has been using GPU-accelerated compositing for about the same time :P

The problem with "3D interfaces" is that they tend to get very hollywood-esc, with effects piled upon effects; these waste user time while doing something flashy. As an experiment, you can use the developer options on an Android phone to slow down the animations, but you will soon see that while it may look smoother, it's a net decrease in usability.

But, to repeat, this is not something that an application programmer should have to take into account. All modern UI frameworks (GDI/WPF on Windows, whatever the equivalent frameworks are called on Linux/MacOS) are GPU accelerated on current platforms (XP, of course, not being current).
« Last Edit: September 28, 2013, 02:30:25 am by The E »
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
the os usually handles the rendering of gui elements for you and you can focus on the main purpose of the app. you usually dont even need to touch a graphics api in that case, and can just use your gui library directly where the underlying workings are all taken care of for you. most gui interfaces also offer a means to implement rendering viewports that can operate raw graphics library commands. heres an example of a program i wrote (its actually a lua script) running a gui library (iup) which i use to graph out sensor data from an arduino.



mostly i just deal with placing controls, and layout, so i dont need to get down and dirty with graphics api calls. however the graphing window is an opengl viewport and actually does use the opengl calls to draw the graph (there is also a 3d vector scope mode not shown), and those are used in cases where you need more rendering capability than your gui interface can do. the os pretty much takes care of everything for you, and if its rendering through an accelerated api, so much the better, but from the application side of things this stuff is mostly hidden from you.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline MachManX

  • 26
  • The Fight Never Ends...This Is A Fact Of Life!
So I guess as I'm writing an app the compiler will link up to whatever 3D components I need and I don't have to worry about complicated things like making the whole interface 3D, right?
AMD Ryzen 5 3600
B450I GAMING PLUS AC
Geforce GTX 1060 6GB
16GB DDR4-3600
WD SN750 1TB NVME
Samsung 850 EVO 250GB SSD
Corsair HX520W PSU
Cougar QBX Case
NEC V422 42" @ 1080p
Ubuntu 20.04 + Whatever I VM

 
your confusion on this matter runs deeper than can really be addressed on a forum post; but: yes, just write standard 2D interfaces and they'll be perfectly responsive.
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.

 

Offline Fury

  • The Curmudgeon
  • 213
There is no such thing as "2D" or "3D" when it comes to whether something is hardware accelerated by GPU. All it requires is tapping into appropriate API, such as Direct3D or OpenGL. It's the API that ultimately controls how what you see in your screen is rendered. If an app happens to be a game, most of the time you are dealing with a framework like SDL or SFML or pre-made rendering engine like Unity, Unreal Engine, etc that do most of the work of tapping into API's for you. But when that is not the case, you can still check if there are usable wrappers for your preferred programming language that helps you with that.

If we're talking about normal Windows app, then your app should be hardware accelerated by GPU as long as desktop composition is enabled and you follow Microsoft's coding guidelines. Those who have used Windows OS since Vista (which means most of us), have at some point or another noticed how Windows switches desktop composition off. This is very obvious as when this happens the interface becomes very plain looking. This happens because Windows encountered misbehaving application that did not play the ball with desktop composition. Soon after misbehaving application is closed, Windows switches desktop composition back on.

Bottom line, most of the time you don't need to know much if anything at all about underlying API's to make use of them. It's when you code with a language that is not using framework (SDL, SFML), virtual machine (Java, .NET/Mono) or wrapper. Common example of such language would be C/C++.

 

Offline MachManX

  • 26
  • The Fight Never Ends...This Is A Fact Of Life!
Ok, now I understand.  So it's about the APIs.   The game engines tap into these APIs when necessary.  I guess the same goes for the Visual Studio compiler (though some people recommend I should be using something else).  But even if what I just typed isn't exactly the correct answer, I guess what I've learned from this is that there are engines or other devices that take care of the low-level programming, which allows us to focus on the high-level functionality of the program.  We only call on what's necessary, regardless of 2D or 3D.


Thanks everyone for helping a beginner like myself understand.
AMD Ryzen 5 3600
B450I GAMING PLUS AC
Geforce GTX 1060 6GB
16GB DDR4-3600
WD SN750 1TB NVME
Samsung 850 EVO 250GB SSD
Corsair HX520W PSU
Cougar QBX Case
NEC V422 42" @ 1080p
Ubuntu 20.04 + Whatever I VM

 

Offline Tomo

  • 28
All modern programs use the APIs for their host system.

This is because there is no point in writing the same code many times - instead you link to a set of libraries written by others (or yourself), and use those to do the various 'general' things.

So in desktop/smartphone development, you write "draw a drop-down list here, a textbox there, an OpenGL (ES) context over there, tell me what happens this way".
The libraries you're using then handle the details of actually creating it, and sending your program the results when a user does things with them like typing, clicking etc.

OpenGL itself is a library with its own APIs intended for 2D and 3D hardware acceleration, so you can tell it "Here is a triangle, display it like this" without having to worry about exactly how the graphics card is going to do it.

The MS Visual C++ compiler is perfectly good for Windows development.
- Last I heard the latest edition didn't yet have full support for C++11 but that doesn't really matter for most people.
(Most commercial software development doesn't bother with the new features of C++11 yet anyway)

I use the Qt Creator IDE with the MS Visual C++ 2010 compiler and Qt 4.x libraries (can't move to 5.x yet due to other software mine couples with).

I found C++ with Qt development pretty easy to learn but I came from Delphi and C so already knew about general programming principles like pointers, references and algorithms.

If you're just getting started with programming, I'd actually suggest getting yourself a Raspberry Pi and trying out Python.
The RPi is impossible to 'brick' (unlike your desktop) as if you really screw it up you can just re-flash the SD Card, and Python is relatively forgiving to learn.
« Last Edit: September 29, 2013, 07:33:19 am by Tomo »

 
If you're just getting started with programming, I'd actually suggest getting yourself a Raspberry Pi and trying out Python.
The RPi is impossible to 'brick' (unlike your desktop) as if you really screw it up you can just re-flash the SD Card, and Python is relatively forgiving to learn.
FWIW, I think the Pi is overkill - you'd have to do some pretty weird stuff to really mess up your system (don't follow tutorials from 4chan :P ). I learned Java, C++, Matlab and Python, and never ever had any system troubles because of it. But if you really wanna be careful, there's also still virtual machines - less expensive (free) and probably easier to work with than the Pi.

I second the suggestion for Python though, it's a great stepping stone towards more complex languages like C++, while also being very powerful in its own right.
« Last Edit: September 29, 2013, 09:23:37 am by FreeSpaceFreak »

 
Yeah you are not going to cause any damage to your system while learning to program.
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
raspberry pi is a pain in the ass if all you plan on doing is development. its only fast enough to run the most basic ide (pretty much just a text editor), compiling will be slow, etc. i think you are better off writing the code on a pc/mac and then cross compiling for arm. its been a thing thats really holding me back from doing anything useful with the pi.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline MachManX

  • 26
  • The Fight Never Ends...This Is A Fact Of Life!
Ok, makes sense.  I just have this fascination with GUI interfaces.  Well not really a love for it but when I see certain interfaces written poorly it pisses me off and I go "I could've done waaay better than that" in my head.  I won't go into details but that's the direction I'd like to go...to build better GUIs or at least products with better GUIs than the competition.  So I wanted to go the Android route because it looks like a lot of people rely on Android for a lot of things.

So of course I could simply dive into Android programming, but is there something I should learn before that?  I'll be taking intro to Java soon, but I'd like to hear from the knowledgeable people here what their opinion is.  By the way thanks for all the advice.  It helps :)

PS: I heard from my club president that we might dive into raspberry pi stuff next month or so.  But it's not confirmed.  Right now we are working on Arduino stuff and I'm still waiting to get my kit as I'm a new member.
AMD Ryzen 5 3600
B450I GAMING PLUS AC
Geforce GTX 1060 6GB
16GB DDR4-3600
WD SN750 1TB NVME
Samsung 850 EVO 250GB SSD
Corsair HX520W PSU
Cougar QBX Case
NEC V422 42" @ 1080p
Ubuntu 20.04 + Whatever I VM

 

Offline Fury

  • The Curmudgeon
  • 213
This obviously doesn't fit all applications, but I like to generally consider it good design when application is first developed as purely command-line application. Which means every feature of the application is accessible in command line parameters and arguments. Then build a GUI on top of that, the GUI's job is to make these parameters and arguments pretty. Not only that caters to power users who get stuff done faster by automating tasks, it caters to new users and those who are not comfortable with command line.

But as I said, this design cannot be used in all applications. Rather, it's mostly useful in tools that are means towards accomplishing a task.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Right now we are working on Arduino stuff and I'm still waiting to get my kit as I'm a new member.

arduino is fun. its really useful if you want to know what happens where the metal meets the code or to interface random bits of low level hardware to your computer, or as a basis for stand alone gadgets.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline MachManX

  • 26
  • The Fight Never Ends...This Is A Fact Of Life!
This obviously doesn't fit all applications, but I like to generally consider it good design when application is first developed as purely command-line application. Which means every feature of the application is accessible in command line parameters and arguments. Then build a GUI on top of that, the GUI's job is to make these parameters and arguments pretty. Not only that caters to power users who get stuff done faster by automating tasks, it caters to new users and those who are not comfortable with command line.

But as I said, this design cannot be used in all applications. Rather, it's mostly useful in tools that are means towards accomplishing a task.

I never considered this but it sounds logical (no I am not Vulcan).  If I ever make a program for Windows I will consider making relevant functions accessible via the command line.

Yeah, Nuke, the club is using it on monster truck-ish toy vehicles with the big tires.  Each axle runs on a separate motor.  They recently installed some kind of sensor on it so that adds to the fun.  Too bad I can't do squat without a kit :(

Wonder if I can use the Arduino in conjunction with Android...like a bluetooth interface or something?  Well, I guess for us programmers the sky's the limit, eh?  But I need to acquire the knowledge first :D
AMD Ryzen 5 3600
B450I GAMING PLUS AC
Geforce GTX 1060 6GB
16GB DDR4-3600
WD SN750 1TB NVME
Samsung 850 EVO 250GB SSD
Corsair HX520W PSU
Cougar QBX Case
NEC V422 42" @ 1080p
Ubuntu 20.04 + Whatever I VM

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
you can talk to arduino over wireless (and wired) connections if you have appropriate hardware. wifi is kind of a complicated thing to deal with on most arduinos (except for possibly the arduino yun which has a linux soc on the board), though there are wifi, bluetooth and ethernet shields out there. i actually like to use the $2-$20 nordic ism rf modules for wireless on arduino, but they are not standard equipment on smartphones. some arduinos can be used as usb class devices which should be supported by your android device's usb stack. there is gsm shield if you just want to use the cell networks. you can probibly even go old school and use infrared if your android device has an infrared transceiver. you just need an ir led, a transistor, a resistors, and an ir receiver/decoder module (and there are breakout boards with all this stuff on it).

you can get arduino to talk to pcs fairly easy. i usually just go through a ttl-usb bridge (what came with the earlier arduinos), and use whatever serial library i can find (like luacom), or for newer arduinos use the usb classes (hid for input devices, or cdc for general communications).
« Last Edit: October 03, 2013, 04:54:08 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN