Questions tagged [gldrawpixels]
32 questions
1
vote
2 answers
OpenGL + libpng: wrong colors on image
Since last week I've been trying to load and show a PNG on the screen. I used a library libpng to copy png into memory and then used glDrawPixels to show it on screen. The result is following:
The original picture:
Screenshot in the "game":
And…

Radosław Wójciak
- 99
- 2
- 8
1
vote
1 answer
how to use glDrawPixels to render a picture as a background
Here is the thing: I want to load a picture as a background filled in the whole viewport. This background should always face to the camera no matter where the camera face to.
First I naturally think use a texture as a background, my code is…

TonyLic
- 647
- 1
- 13
- 26
0
votes
2 answers
Having trouble useing glDrawPixels
I have to use glDrawPixels to implement a raster algorithm.
Right now I'm only trying to get a simple example of glDrawPixels working but having an issue.
GLint height, width, size = 0;
GLbyte *image = NULL;
int i,j=0;
width = 512;
height =…

shbi
- 90
- 8
0
votes
1 answer
OpenGL and GIMP image file exported as .c file
I have drawn an image file with the GIMP and saved it as a .c file.
Then I used the following in my OpenGL code to load the image onto
the screen:
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glRasterPos2i(x_disp, 0);
glDrawPixels(80, 80, GL_RGB,…

John Goche
- 689
- 2
- 12
- 27
0
votes
1 answer
glDrawPixels: cannot see program output
I am trying to follow the glDrawPixels example from Chapter 8 of the red book
(which is incomplete) but cannot see anything (I just see a black screen with
no pixmapwhen I run the code. Any ideas what I am doing wrong?
#include
#define…

John Goche
- 689
- 2
- 12
- 27
0
votes
1 answer
How to use Eigen in glDrawPixels
I have a vector std::vector frameBuffer in Rasterization, and I want to use it in glDrawPixels().
The Rasterization.h
class Rasterization {
public:
Rasterization(int w, int h);
void clear();
void drawTriangle(Triangle&…

Interesting
- 39
- 3
0
votes
1 answer
FullScreen picture from webcam
I use openCV to take picture from the cam. Here is code:
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glScalef( 1.0f, 1.0f, -1.0f);
glTranslatef(0,0,FOCAL_LENGTH);
glRasterPos2d(-width/2,height/2);
glPixelStorei(GL_UNPACK_ALIGNMENT,…

EthanHunt
- 473
- 2
- 9
- 19
0
votes
3 answers
glDrawPixels/glCopyPixels to get a magnified view producing severely clamped image
Despite an earlier question (asked here), our project is constrained to using glDrawPixels, so we have to do some hackery.
One of the feature requirements is to be able to have a magnified view show up on a clicked region of an image; so, looking at…

mmr
- 14,781
- 29
- 95
- 145
0
votes
1 answer
c++ opengGL: Draw polygon + image processing interior pixels
I am using opengl and c++ doing image processing. The idea is simple, I will load an image, draw a polygon by clicking and then apply an effect (desaturation for instance) only to the pixels in the interior of the polygon shape just created.
Can…
0
votes
1 answer
Drawing pixels from buffer and position (glDrawPixels)
Basically I am doing some tests to simulate various window inside a scene. Everything works fine until I try to position better the window that I am drawing inside the scene.
The important code is here:
// camFront = glReadPixels ...
glMatrixMode(…
anon
0
votes
1 answer
Using OpenGL and Cuda get a run time error for an Access violation reading location
I would just like to start by saying I am new to CUDA and OpenGL. I get the above runtime error when it runs glutMainLoop() and the mainloop runs glDrawPixels(). I have looked everywhere to figure out why this isn't working any help would be…

Tyler Gauch
- 160
- 1
- 6
0
votes
0 answers
glDrawPixels optimization with textured quad
I have a system in which I cache the back buffer of each windows in an allocated memories whenever redraw() finished its execution. The back buffer is being stored as an array of unsigned long where the content was read into as followings, and the…

null
- 63
- 6
0
votes
1 answer
DevIL PNG format for display in OpenGL
I'm doing some pixel work in OpenGL, and all was going well until I had to load a PNG. I found a thing called 'DevIL', and followed an example I found. It does display something, but it's just kind of a random rainbow. I'm doing it right as far…

user2345349
- 5
- 1
0
votes
1 answer
WebGL drawPixels?
I have an array of pixels from a gl.readPixels() call. Can I put those pixels back to the drawing buffer or a framebuffer? i.e. I'd like to call something like gl.drawPixels, but there is none in the WebGL API. Am I to use a texture and render it…

Andy
- 145
- 1
- 1
- 4
-1
votes
1 answer
glDrawPixels in opengl or jogl
I have a file in i j r g b format, where i and j are pixel coordinates and r,g,b are colour values ranging from 0-255.
I have scanned them from the file in a single array(in row major order) but my draw pixel is not working as expected. Please help…

Archit
- 369
- 1
- 3
- 8