Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw graphics on screen without using any framework or library?

Tags:

c++

graphics

I want to manually draw the graphics, what that mean is without using any library or frame work like QT, directX , whindow.h .... like giving command to every pixels on the screen to show some specific color at different time. Every body gives tutorials on based on these library or whatever they are called. What i want is to make my own GUI. As far as I could think it is going to be very complicated, hard to learn and to understand, messy and a lot of time consuming, but I am ready for that. I need some resources to understand that.

and Yes i know C++ so it would better if I had to work with this language but I will learn other language if it is required, just i want to know which language i should learn.

like image 557
Sanmveg saini Avatar asked Mar 12 '16 06:03

Sanmveg saini


People also ask

Can you display graphics with C++?

Graphics in C++ is defined to create a graphic model like creating different shapes and adding colors to it. It can be done in the C++ console by importing graphics. h library to GCC compiler. We can draw the circle, line, eclipse, and other geometric shapes too.

How do you draw a line in C++ without graphics?

Show activity on this post. I looked at your 'c' question. std::cout << Ansi_t::clrscr() << std::flush; // clears the screen std::cout << Ansi_t::gotoRC(5, 25) << '*' << std::flush; // position the cursor, and output a single 'dot': Now use this to draw a line, etc.

Which function is used to draw a line?

line function is used to draw a line from a point(x1,y1) to point(x2,y2) i.e. (x1,y1) and (x2,y2) are end points of the line. The code given below draws a line.


Video Answer


2 Answers

In the old days, you could write directly to video memory with no help from the operating system/ROM. Today, on current hardware, you have to go through the operating system in order to write to the screen. That means using a separate library (like Qt) or using the OS features (windows.h). You could use directX or something and get more raw access to video memory, but that is still using a library/framework.

like image 188
Rob L Avatar answered Sep 29 '22 22:09

Rob L


If you want with C++ and native Windows API (without DirectX) , you should use GDI(Microsoft Graphics device interface) + MFC(Microsoft Foundation Classes) this is a classic implementation of Windows GUI, If you want complicated graphics with shaders you need DirectX/OpenGL without hesitation. meanwhile if you want higher programming framework you can use C#(CSHARP) or Java.

like image 40
Achiko Mezvrishvili Avatar answered Sep 29 '22 23:09

Achiko Mezvrishvili