Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphics using Standard C++ only?

I just want to know whether Standard C++ allows GUI programming?

There are 2 aspects of this:

  1. Widgets for UI like window, dialog, push button, etc
  2. Graphics like drawing circle, rectangle, spline, etc

I have been using Qt for my UI & haven't seen anybody doing GUI in C++ only.

PS: I am concerned with C++ language only, I know that Java allows GUI programming!

UPDATE: A new question was added here: How frameworks like Qt create GUI, if C++ has no functionality for that?

like image 959
Cool_Coder Avatar asked Mar 25 '13 09:03

Cool_Coder


People also ask

Can C be used for graphics?

Graphics programming in C used to drawing various geometrical shapes(rectangle, circle eclipse etc), use of mathematical function in drawing curves, coloring an object with different colors and patterns and simple animation programs like jumping ball and moving cars.

Is there a graphics library for C?

Most people use the gd library for rendering from C but you must implement the "math plotting" part.

Why C language is used for computer graphics?

C however may do more and perform faster because it's closer to machine code, etc. The computer graphics language determines what you are trying to do. So, when it comes to 3d, for example, Java has Java3D, which is an API, which is much easier for Object-oriented design.


2 Answers

No, this isn't possible. C++ works on many devices, some of which simply don't have that capability.

Qt can do this, usually because the Operating Systems on which it runs do offer that functionality. It's usually exposed as a set of C functions, which in practice means they're callable by the C++ code in Qt. What the OS uses internally, who knows. It may even leave some of the work to the GPU nowadays.

And on some embedded systems, Qt just gets a pointer to the screen memory, and does all the pixel manipulations itself. That's not a solution when you have to share the screen with multiple applications, but for single-function devices it definitely works.

like image 180
MSalters Avatar answered Sep 22 '22 20:09

MSalters


No. There is nothing about GUI in C++ standard.

Frameworks use OS facilities. Standard C++ - no.

like image 45
ForEveR Avatar answered Sep 21 '22 20:09

ForEveR