Skip to main content

All Questions

Tagged with
4 votes
1 answer
52 views

OpenGL viewport is of incorrect dimensions compared to window set to same dimension

I have a window of 600x400, the viewport on which OpenGL is rendering appears to be much smaller (pictured below). Picture of the viewport I'm expecting and the viewport I'm getting, note most of the ...
JadenJin's user avatar
0 votes
0 answers
57 views

Can I get my texture coordinates as pixel coords in 2D Game?

I have an issue with my 2D Game in C++/OpenGL. I need to somehow get the pixel coordinates (preferably the glfw coords) of a texture that has been rendered on the screen. The final goal is to be able ...
notfynnaf's user avatar
-1 votes
2 answers
230 views

Generating data for OpenGL 2D rendering perfomance is slow but Monogame.GL's data generation/rendering methods are speedy. How? (CPU Perfomance?)

I am trying to make a custom tile map editor using OpenGL, C++ with GLFW(Version 3.3.8) library but I am having major issues with generation speeds but I can run games that have large tile maps such ...
sonofjacks's user avatar
0 votes
0 answers
124 views

Make a multi-color circle in GLUT

I am trying to make a pie chart in glut. Is there a way that I can draw a single circle and change the color of the circle when I get to certain points? (for example i want half of the circle green ...
Ertugrul Gacal's user avatar
0 votes
2 answers
96 views

2D basic transformation combination

I have a 2D transformation problem in OpenGL. My program draws two letters on screen and, by pressing assigned keys, letters have to move up (GLUT_KEY_UP) down (GLUT_KEY_DOWN) left (GLUT_KEY_LEFT) ...
meinhardis's user avatar
0 votes
1 answer
62 views

OpenGL clear sprite

I created 10 sprites on the window and now I want to clear only one sprite out of 10 sprites. Now the function glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) clears the entire window of sprites, ...
Evil JuniorCplusplus's user avatar
0 votes
1 answer
421 views

Bezier Curves OpenGL Move 3d Space According to 2d space

I am trying to think about the following problem logically: Move an object in the 3d space in a fashion that represents a 2d user-generated bezier curve. As of right now, the user can create his own ...
RRIL97's user avatar
  • 858
0 votes
2 answers
2k views

Resizing window(framebuffer) without stretching the rendered content, (2D orthographic projection)

Im trying to retain the ratio and sizes of the rendered content when resizing my window/framebuffer texture on which im rendering exclusively on the xy-plane (z=0) and would like to have an ...
bonkt's user avatar
  • 17
0 votes
2 answers
771 views

Black lines between 2d textures

I just started learning opengl technology. My program draw 2d isometric tiles and program output this: Be unknown reasons black lines appear when two textures overlap or two textures touch. Code ...
Evil JuniorCplusplus's user avatar
0 votes
1 answer
381 views

Moving multiple 2D shapes in OpenGL with key press

I'm currently wanting to make it so that these shapes can be each individually moved when I press a certain key, but am not sure how to properly implement this; I have looked at this question How do I ...
uwu's user avatar
  • 1
0 votes
1 answer
919 views

GLSL: Fade 2D grid based on distance from camera

I am currently trying to draw a 2D grid on a single quad using only shaders. I am using SFML as the graphics library and sf::View to control the camera. So far I have been able to draw an anti-aliased ...
Dan Medinsky's user avatar
3 votes
1 answer
84 views

How do I convert my point light into an oval/ellipse?

I am looking to turn my current circular light into an ellipse by having a vec2 radius which can have different x and y values. Is there any way to do this based on my current code in the fragment ...
tomatto's user avatar
  • 149
1 vote
2 answers
146 views

Resizing window cause my 2D Lighting to stretch

I am trying to implement a simple artificial 2D lighting. I am not using an algorithm like Phong's. However, I am having some difficulty in ensuring that my lighting do not stretch/squeeze whenever ...
tomatto's user avatar
  • 149
1 vote
1 answer
1k views

OpenGL: Move 2D Orthographic Camera with Mouse

I'm making a level editor for my game with OpenGL in C++. I'm trying to make Editor Camera just like in Unity Engine 2D Scene Camera, but I have an issue when I try to implement mouse movement for the ...
U Prashanth's user avatar
0 votes
1 answer
128 views

OpenGL viewport from -50 to 50 instead of -1 to 1

Is there a simple and efficient way to make the 2D OpenGL viewport go from -50 to 50 instead of the usual -1 to 1? Or to be able to scale it by any amount?
user14150338's user avatar

15 30 50 per page
1
2 3 4 5
8