How to draw a colored line in dev C++ - dev-c++

I am facing trouble drawing a colored line in the console using dev C++.
I have tried searching it in Google but cant find a single code related to it.

You need a graphics library. In TC, you can use graphics.h, but graphics.h can't be used in dev c++ because of incompatible compiler. But you can choose openGL or just windows API.

Related

C++ basic setup for using openGL

I have windows 8.1 OS.
I wanted to run a basic C++ program using openGL so i downloaded a compatible Turbo C++ software of 64 bit.
When I run my program I got errors because it said unable to open the header file i.e., graphics library. Are there any primary things like setting up a path in environmental variables, which URL should I paste? Or let me also please know if there's any other common things that I need to set up in-order to use the Graphics Library. Thank you.
Do not use Turbo C/C++ , Try any modern IDE (Codeblock , codelite , dev-c++ or any other). Read this
http://www.codeblocks.org/downloads/26
In IDE you will get all common header files plus examples , you will get an OpenGL example here . I suggest you to try codeblock.
Why not to use Turbo C/C++ (https://stackoverflow.com/a/1962710/4499919)
OpenGL isn't suppported by TC++.
However you can run a simple C graphics program using graphics.h
Open Options and select Directories from it.

Force Unreal Engine to use opengl on windows executable

I'm attempting to make a video game in Unreal Engine 4.9. I'm building it for Windows, but I'd like to have it use opengl instead of directx in the executable. However, I've found no options that let you do this. Unreal Engine uses OpenGL when it creates executables for Linux and Mac, but there seems to be no way to use OpenGL with Windows.
Am I missing something? Is there some way to force Unreal Engine to use OpenGL in Windows executables?
EDIT: The reason I want to use OpenGL is because I want this game to run without having to install anything on the end user's computer (DirectX has to be installed to work)
Microsoft doesn't really support OpenGL, they typically go out of their way to make it very difficult to use OpenGL on Windows and strongly encourage people to use DirectX instead.
The simplest way to get a working OpenGL context in windows is sometimes to use ANGLE which is a compatibility layer which translates OpenGL calls to DirectX calls. This is what Chrome and Firefox use to support WebGL on windows. I doubt that Unreal Engine is integrated with this, so you might have a hard time.
Edit:
EDIT: The reason I want to use OpenGL is because I want this game to run without having to install anything on the end user's computer (DirectX has to be installed to work)
One thing you could do is cross-compile the Mesa3D drivers, as described here: https://wiki.qt.io/Cross_compiling_Mesa_for_Windows
But then you won't get hardware acceleration.

Setting up modern OpenGL with Visual Studio 2013

I have been coding OpenGL for a while now using Java and LWJGL. However recently I decided that I would switch from Java to C++.
I managed to set up OpenGL with Visual Studio 2013, and had some fun with that. However I am used to using modern OpenGL (shaders, vbo's, vao's etc...), and I believe what I am looking for is OpenGL ES.
I have been using the GLFW library to create a window with OpenGL context, so how do I do this with OpenGL ES.
I tried adding the #define GLFW_INCLUDE_ES31 line to above the glfw3.h include, however then it cannot find the GLES3/gl31.h header file. I don't know how to obtain this file on my computer, because the GL/gl.h file was just on my computer by default.
Am I supposed to download it?
Apparently OpenGL ES is aimed at smartphones or less powerful devices, so I was wrong in thinking I wanted to use OpenGL ES. In that case, how can I use these newer functions within Visual Studio, and C++. At the moment I only seem to have access to OpenGL 1.1 functions.
You are lacking a loader (GLEW for example)
"just" add it to your project and you will be able to use the GL_ functions again

Where to get an up-to-date OpenGL32.lib?

this one drives me crazy. I've been searching for two days but cant find any answer.
I want to develop some things with OpenGL 3 (or newer) with Visual Studio 2010 / C++.
The header and libraries provided by Microsoft are way too old to support OpenGL 3, so I'm trying to find newer versions. I easily found the header file in the OpenGL registry (http://www.opengl.org/registry/) but I cant find the OpenGL32.lib anywhere. How am I supposed to link a program without it?
There isn't a newer OpenGL library for windows, and there won't be. They decided to stop at OpenGL 1.1 and even call it a legacy graphics.
However, you can use load opengl function, and that is how people get access to the latest opengl features.
You can also use GLEW library to get access to the opengl functions.

Which C++ GUI library should I use

I'm developing a segmentation tool (for research purpose, not for commercial use) and I was wondering which graphical user interface should I use as there are many.
I'm looking for a relatively simple interface which allows me to do as follows on the same window:
*Input variables that will be used by the algorithm
*Browse a folder and select images
*Call functions by clicking on a button
*Display an image that will evolve while the algorithm is running
I'm coding in c++ with visual studio 2010 and I'm using additional libraries such as OpenCV, so the GUI library must be compilable and usable on console project on VS2010.
So far I've tried Qt, FLTK, GTK+ but Qt as compatible issues on x64 architectures, FLTK is lacking documentation and I'm not sure it answers to my needs and GTK+ wasn't working.
Thank you very much for any input and help you can give me.
Keep it simple.
If working with C++ on Windows with a "non-express" version of Visual-Studio, just use MFC.
The framework is mature and there are tons of reference, examples and samples on the web (codeproject, codeguru, MSDN, ... )
Have you tried OpenCV's own highgui?
http://opencv.willowgarage.com/documentation/python/highgui__high-level_gui_and_media_i_o.html
"While OpenCV was designed for use in full-scale applications and can
be used within functionally rich UI frameworks (such as Qt, WinForms
or Cocoa) or without any UI at all, sometimes there is a need to try
some functionality quickly and visualize the results. This is what the
HighGUI module has been designed for."
Also see: OpenCV and creating GUIs