Make a simple 2D library with OpenGL [closed] - opengl

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I would like to create a 'simple' 2D library with OpenGL. I want to use OpenGL because I know I will learn lot of things that's why I don't want to use a higher level library (like SDL).
I know there is some library to make OpenGL a bit easier:
freeglut: I saw a recent release (freeglut 3.2.1 in 29 September 2019) but is it still used?
glfw: it seems more modern but seems too high level
I don't know if we can compare these libraries but what is the 'best' library (between glfw/freeglut) for learning?
There is also GLEW but I don't understand what is it.. Is it required? I just know it's unrelated with freeglut or glfw..

What is the 'best' library (between glfw/freeglut) for learning?
The best library is not using any if you really want to learn all the details.
You will need to learn how to load OpenGL functions on the fly based on the OpenGL version and extensions you want. You also will learn how to use your windowing system (e.g. Win32, X11, etc.) to create a window suitable for OpenGL rendering.
Typically most developers avoid some or all of that by using a library that loads OpenGL functions (e.g. GLEW) and/or creates the native window (e.g. SDL, glfw, glut; which typically work for several platforms), but you can do it by yourself if you really want.
A good option is to pick SDL and use it only for window initialization. That leaves you to load the OpenGL functions you use, which is fairly easy. Then, when you need input, you can use the SDL input subsystem too.

Related

Ubuntu c++: The easiest way to display a 3D mesh and a 2D image together? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I've been fighting with several libraries (irrlicht, Ogre3D etc) and falling between either too complex libraries or too complex installation guides.
I'd appreciate some pointers to how to achieve what the title suggests.
Thanks
If you're going for simplicity of setup and use, I'd recommend you Unreal Engine. It not only allows you to render both in 3D and 2D, but has a lot of other functionality including scripting in c++.
If you're looking for a more lightweight solution, though not as easy, you can try using OpenGL. It is quite easy to set up - just install Code::Blocks and start with their OpenGL template. Although it is much harder to learn and use, it is very developing.
If you don't really need to use c++, you can use Unity. Although its interface is exposed through c#, its not very hard to learn for a c++ programmer. I also find it easier to use than Unreal Engine.
I would also reccomend Vulkan, which would probably the most perforamant of all of them, but well, you wanted a "simple" solution.

Open a windows with OpenGL context [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have worked with SDL. I would like to know how I cound open the window with opengl context on windows
OpenGL on its own does not acknowledge the existence of the window, or any meaningful concept of a window. You need a windowing API. OpenGL will then have a rendering context passed to it by the windowing API.
<windows.h> is the WIN32 API for Windows, and the prototypical go-to API for creating windows when writing OpenGL applications for the first time on a WinOS computer. I don't know what the equivalents for MACOS and Linux are (X11, maybe?) but they have their own flavors.
For a wide variety of reasons (namely the fact that those APIs are old and arcane and obtuse to work with), there are a lot of APIs that wrap around the native Windowing API, and are much preferred for beginners. GLFW is one such example, and my personal preference, as it works out-of-box for Windows, Mac, and most Linux windowing APIs. SDL is another staple, though I get the sense it has fallen out of favor recently (it seems like it tries to do "too much" on its own).
I don't know the functionality of <glu.h>, but given that the whole thing is deprecated, I don't advise using it.

What is the difference between FreeGLUT vs GLFW? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
My university started teaching a course which includes OpenGL programming. They make us use FreeGLUT to create a window and a context for OpenGL, but I found an online course at lynda.com about OpenGL in which they use GLFW instead of FreeGLUT.
So I want to know which one should I use and what are the differences between the two?
FreeGLUT:
Based on the GLUT API.
GLUT has been around for about as long as OpenGL itself.
Many tutorials and examples out there use GLUT.
Takes care of implementing the event loop and works through callbacks (good for simple stuff, makes things like precisely timed animation loops and low latency input much harder though).
GLFW:
Designed from scratch with the experiences of other frameworks in mind.
Gives much finer control over context creation and window attributes.
GLFW-2 Provides basic threading support functions (thread creation, synchronization). –– removed from GLFW-3
GLFW-2 Provides basic image file loading support. –– removed from GLFW-3
Gives very detailed access to input devices.
Event loop is in control of the programmer which allows for much preciser timing and lower latency.

How to set up OpenGL environment in Windows 7? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am new to OpenGL. I have to develop a simple 3D application. I read from Google that I have to install GLUT and OpenGL. Is that right? Can you tell what exactly should I install?
Any link for proper download is appreciated.
Google that I have to install GLUT and
You don't need GLUT necessarily. A lot of tutorials use it, though.
OpenGL. Is that right?
Well, OpenGL is mostly an API to the drivers. So what you actually need are the drivers for your graphics processor directly from the vendor. The drivers Windows7 installs automatically lack modern OpenGL support.
So just head over to http://intel.com or http://amd.com or http://nvidia.com, depending on your GPU, and download the drivers for from their site directly and install them.
What I highly recommend is getting GLEW: http://glew.sf.net – it makes things to much easier in the long run. Especially if you want to do anything beyond OpenGL-1.1 you'll have to use the so called extension system which is a bit tedious to use directly. GLEW hides this all behind a single function call to glewInit(), once you've got a OpenGL context.

What would be a good library to draw to the screen in c++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I am creating simulation that models how an gas behaves in a container. I have collision checking set up, however I would like to draw the data on screen to make sure it is working correctly
All I need is a simple way to draw simple shapes such as circles to the screen using c++. these shapes do not have to look great, just function.
I may want to move my simulation from 2D to 3D in the future as well - so a library that has 3D capabilities would be good.
Remember I will be looping through and drawing several hundred gas molecules, so fast would also be good.
I am fairly new to c++ as a language so go easy. My IDE/compiler is VS 2010 Professional.
I have already used google - but I can not find any good installation guide for installing the library. So an installation guide would be a big plus
Look at SDL with SDL_gfx. You can then switch to SDL/OpenGL to do 3D.
I would recommend OpenGL, it's easy to use for your task. Also it's cross-platform and you can easily switch to 3D.
OpenGL is one possibility, though there are also other libraries built on top of OpenGL that might be useful as well.
Edit: OpenGL itself is installed as part of the OS. Headers and libraries for OpenGL 1.1 are included with VS 2010, so if you don't need newer features, you're already set. If you want to use newer functions, you probably want to use GLEW or GLEE.