S
S
SanQri2019-01-19 01:56:17
C++ / C#
SanQri, 2019-01-19 01:56:17

Is there a way in OpenGL to draw 2D images without unnecessary transformations (immediately in screen coordinates)?

Hello. I want to write a 2D game in C / C ++, the choice fell on OpenGL. Obviously, one of the first questions for me was the issue of rendering 2d sprites. The ways that I found are that we create a rectangle in world coordinates and draw a texture on it. As far as I understand, between setting the texture and displaying it on the screen, there will be a single-scale transformation and zero rotation, and then a translation from world coordinates to screen coordinates. I want to immediately draw in screen coordinates. Is it possible to do this in OpenGL or should I look for another graphics api?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
longclaps, 2019-01-19
@SanQri

glDrawPixels

T
Taras Fomin, 2019-01-23
@Tarik02

What is the problem with conversion? Create an orthographic matrix to fit the window and draw sprites already with it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question