Questions tagged [opengl]

OpenGL is a graphics standard and API which targets the Desktop, workstation and mobile markets. It is designed to be easy to accelerate with dedicated computer hardware, and hence most implementations give greatly improved performance over traditional software rendering. OpenGL is used for applications like CAD software and computer games. It is also cross-platform and with bindings for several programming languages.

Filter by
Sorted by
Tagged with
1
vote
0answers
7 views

Border Radius in OpenGL

I'm a total noob to OpenGL just following the tutorial at learnopengl.com. Anyway, I'm trying to build a GUI that involves rectangles that have border radiuses. I figured I could do this using the ...
4
votes
1answer
242 views

C++ wrapper class for array of OpenGL buffer objects — just the constructors

A similar question was asked here, and I'm trying to do the same thing. But I'm trying a different approach by deriving from std::array, and This is a very focused ...
3
votes
1answer
73 views

OpenGL Mesh Class

I've written a simple mesh class. The purpose of it is to build a mesh, draw it to the screen, and provide some means by which the mesh can be transformed/scaled, etc. This was done with GLAD, GLFW, ...
8
votes
2answers
108 views

Remaking a 1998 RTS game in C++

I am remaking a very obscure old game called Rival Realms. The full source is here if you're interested. I come from a Java background so C++ is still fairly new to me. I recently performed a ...
9
votes
4answers
2k views

A camera controller API for my game engine

As a hobby I am working on a game engine in order to learn C++ and graphics programming, now I have completed my first iteration of my camera system using OpengGL and GLM. Because I am mostly self ...
7
votes
2answers
477 views

pyopenGL OBJ loader improvements

Current OBJLoader: Using pygame's obj loader as a base, I created a new obj loader for Python OpenGL. The loader includes the following functionality: Collect vertices, normals, and texture to draw ...
1
vote
0answers
33 views

OpenGL fragment shader optimization questions [closed]

My (simple) game engine has one big fragment shader for the whole scene. Right now, with multiple objects, collision detection and bloom post-processing (4 linear passes) I get frame times of ~18ms ...
1
vote
1answer
79 views

Shader class in OpenGL

Im am currently wrapping all OpenGL ressources (which are simply a GLuint) into classes that own and manage the deletion of them, to make it possible to use OpenGL in an object oriented fassion. Since ...
7
votes
3answers
583 views

C++/Opengl voxel renderer

I have tried going back to C++ after long time of mainly doing C#. I realize that the code is far from perfect, however I would really appreciate if someone could point of what exactly is wrong and ...
4
votes
0answers
100 views

Python OpenGL snake

So I decided to dust off my Python and OpenGL knowledge and make a simple snake-like game. I will be really grateful for any critique or improvement. snake.py <...
5
votes
1answer
151 views

OpenGL shader abstraction class

I have implemented a class to abstract the process of building a shader program in OpenGL (For now it does not deal with uniforms). I would like some feedback on the coding style, and more ...
4
votes
2answers
60 views

Loading and drawing an image

I have some functions and structs for loading and drawing an image with OpenGL. The two main places I would like feedback are: I've tried to separate the OpenGL-specific code into the implementation ...
3
votes
0answers
148 views

OpenGL C++ snake game clone

I've been learning OpenGL and C++ recently and thought I'd attempt to make a snake game. It would be amazing if you could take your time to read my code and give advice please. Please prepare yourself ...
3
votes
0answers
57 views

Multithreaded OpenGL Rendering Pipeline

I've decided to move my rendering code to a separate thread, to help facilitate the move I've created a pipeline system for rendering. With this pipeline I can insert commands into a queue which will ...
6
votes
1answer
90 views

Per pixel Image Computation with Gamma Correction in OpenGL and C [closed]

I've been working on a way to optimize pixel computation in OpenGL with C. If this information helps, my current environtment = Linux (terminal) + GPU (Nvidia 1080Ti). I'm working with old OpenGL (...
7
votes
2answers
183 views

Universal OpenGL object RAII wrapper class

I created a universal OpenGL object RAII wrapper class, that only takes care of object creation and destruction. Here's my code and reasoning behind it: I first wrote a class that would take ...
8
votes
1answer
178 views

Note-drawing program

This program draws a random music note on a staff, refreshing the note every second. It compiles with g++ and also emscripten, so it is runnable in both the browser and on desktop. This is my first ...
3
votes
1answer
455 views

C++ OpenGL - GLFW Window Abstraction

I made a GLFW window abstraction, as I find it very useful for me to make such abstractions while learning an API, and It actually pretty much eases my work while coding. Anyways, share your ...
3
votes
1answer
165 views

C++ OpenGL GPU resource wrapper pattern

So with OpenGL(and I'm assuming other GPU APIs) you create different buffers/programs/etc that live on the GPU and you are given a handle to them when created. For instance, if you want a buffer to ...
3
votes
0answers
109 views

Using a large number of actors in one render scene with vtk python

I used vtk python examples to write this function where it produces two lines with respect to a reference point like [0, 0, 0]. This function will return an actor ...
1
vote
0answers
98 views

C++ OpenGL minimal VAO example

Alright, so first, the reason I'm posting this is because I've seen so many tutorials that conflict with each other, and I would like to get this all straightened out. (Ignore the lack of shaders/mvp ...
3
votes
3answers
91 views

Refining an OpenGL tutorial demo

I'm working my way through the examples in an OpenGL website; I'm now on tutorial 2 ("the first triangle"). Among the (many) things I've changed from the sample include: Replacing the hodge-podge of ...
5
votes
1answer
57 views

Mouse control of a camera in an OpenGL program

Introduction I'm doing an OpenGL program in C. As of now I'm working on the 3D camera system and got the control right. Now I'm working on the mouse control. It works, but I have used two different ...
3
votes
0answers
336 views

Implementing Cyrus Beck algorithm for convex polygons

I have found the coordinates of the centroid for finding the direction of the normal vectors of the edges of the convex polygons. This method seems to work in the cases I tested. Is this fool proof ? ...
7
votes
2answers
657 views

Abstracting OpenGL shaders and uniforms into objects for ease of use

I am following an OpenGL tutorial series and it got to the point where the program needed some code abstraction. I followed the tutorial on the abstraction of VBOs, IBOs and the like and when it got ...
6
votes
2answers
652 views

Simple OpenGL / C++ Game Engine

I come from a C# background and recently have been trying to improve my C++ and OpenGL. I've hacked together a basic 3d engine and am looking for feedback as to how to improve it. One bit I'm most ...
3
votes
1answer
207 views

2D rendering abstraction

This is a simple 2D rendering abstraction that I've been using for my game. It's basically a vector of quads. It has functions for defining quads (position, rotation, texture coordinates) and a ...
2
votes
2answers
113 views

C++ OpenGL Debug Utility (Completed)

So I had posted C++ OpenGL Debug Utility before to get some feedback on it, this is a more complete version of the class. (Again, looking for feedback/critiquing of any sort. {As I'm in the early ...
3
votes
1answer
100 views

C++ OpenGL Debug Utility

Edit: A follow up post can be found here. So I've started a c++ project, coming from Java / C# there are many obvious differences. Below is an example of a class I've been working on: .h ...
1
vote
0answers
221 views

GLSL Simplex Noise with derivatives

I recently made 2d simplex noise based coherent noise in GLSL. [Here] is the shader toy. I wanted to make an implementation of simplex noise on the gpu in order to get better performance than the CPU ...
3
votes
1answer
116 views

Voxel engine to draw cubes

I am an amateur in OpenGl and for this reason I am seeking to learn only modern OpenGl the 4.x stuff. Once I had completed basic tutorials (rotating cubes, for example) I decided I would try and ...
2
votes
1answer
377 views

GLFW simple event handler

I wrote a simple concept of an event system in cpp. It is uses a namespace and a global state, but normally a global state with namespaces is bad practice. Is there a better way to do simple event ...
3
votes
1answer
2k views

Window class for a game engine

I am writing my own game engine, and I wanted to share with my own window class written in C++ using GLFW as the windowing API. Is there someone who can help me better this class? I'm not a complete ...
5
votes
0answers
1k views

3D FPS Camera in OpenGL

So I've got a basic FPS camera working which can move around the 3D space. Having trouble with physics but thats not why I'm here! So the code below creates a scenegraph which contains torus model ...
1
vote
0answers
201 views

Golang Opengl OBJ Loader

I'm trying to get better in go by make a 3D game. (Yes, I know that's a lot of work but I'm doing it for experience and not to make a profit.) And I want to improve the loading of the OBJ Files as ...
2
votes
1answer
2k views

Better QOpenGLWidget by delaying GL code to initializeGL with lambda functions

When I am writing OpenGL applications with the QOpenGLWidget class, deciding what code goes into the initializeGL function has ...
1
vote
1answer
555 views

Modern OpenGL shader wrapper v2

This is a fixed up version (following RAII principles) of my previous reviewal. I have moved the construction of the object entirely to the constructor to prevent any bad object states. The only ...
2
votes
1answer
313 views

Implementation of OpenGL context

context.h: ...
0
votes
1answer
142 views

OpenGL framework “SOGL”

Here is my repo, pull requests are always welcome ^^ I know that OpenGL frameworks already exists (OGLPlus, for example) but I developing another one following this set of reasons: To understand how ...
2
votes
1answer
905 views

Modern OpenGL wrapper abstractions (shaders)

I am experienced with other languages, but not so much with the latest C++ standards. I was wondering if anyone had any tips on how to improve my code or any critique on my implementation. This is not ...
1
vote
1answer
638 views

Vulkan and Opengl swapable rendering backend

I'm working on a multi render library. The point of it is to have a swapable backend at runtime to render the same item. The renderer is given to the window (which is a wrapper over SDL2). Then the ...
1
vote
0answers
92 views

Purely functional minecraft-like mesh compiler

I'm creating a minecraft clone (for practice), in scala, using largely functional programming. When a chunk doesn't have a mesh loaded into VRAM, it create a Future for the vertex and index arrays, ...
4
votes
1answer
954 views

OpenGL 3 Mandelbrot Set

I've written a short program to learn about computing with drawing using OpenGL 3. To do so, I created a program to create two triangles, which form a quad, and pass all the arguments for computing ...
7
votes
1answer
585 views

Metaballs and Gravity game;

For past two days I made my first OpenGL project, I know, It's fixed pipeline, but my focus was on gravity algorithm, so, tell what do you think, and how can I make it faster? main.cpp ...
4
votes
1answer
486 views

OpenGL 4.5 Core Buffer wrapper

I recently wrote this OpenGL buffer wrapper which covers the 4.5 Core specification. I feel like the typed interface could be done better. Any feedback is greatly appreciated. ...
10
votes
2answers
1k views

Mandelbrot Fractal Drawer in C++

As an exercise to learn how OpenGL and image creation worked, as well as to satisfy a curiosity I've developed for Chaos Theory, I decided to create a mandelbrot fractal drawer in C++, which can ...
4
votes
1answer
2k views

Simple Minesweeper using OpenGL / GLUT

I'm trying to make minesweeper similar to windows 3.1 minesweeper by using OpenGL / GLUT. The game still in early stage but playable. I would like to know, how can I improve it. EDIT 1: i added ...
4
votes
0answers
450 views

Python Code For Drawing a Fractal Tree using pyglet

So I've just finished doing a coding challenge that involved drawing a fractal tree. Instead of doing it recursively(which is what I did initially but it proved to be to slow for branches greater than ...
1
vote
0answers
751 views

Texture Loading in LWJGL 3 - follow-up

Here's my optimized Texture class: ...
1
vote
1answer
691 views

Texture loading in LWJGL 3

I made the following class to simpify texture loading in LWJGL 3, and modeled it after the slick-util API: ...