Home How to convert an array to PGLint (ie:^integer) in delphi?
Reply: 1

How to convert an array to PGLint (ie:^integer) in delphi?

David Heffernan
David Heffernan Published in 2017-09-12 14:37:11Z

I have this openGL function declared in delphi :

PGLint = ^GLint;
GLint = Integer;
glTexParameteriv(target, pname: GLenum; params: PGLint);

in the sample i found on the web this function must be call like this :

int crop_rect[4] = {x, y, width, height};
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop_rect);

However i don't know how to translate the crop_rect in delphi ? especially how to pass it to glTexParameteriv ?

David Heffernan
David Heffernan Reply to 2017-09-12 14:47:44Z

Like this:

  crop_rect: array [0..3] of GLint ;
crop_rect[0] := x;
crop_rect[1] := y;
crop_rect[2] := width;
crop_rect[3] := height;
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, @crop_rect[0]);
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308543 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO