Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

OPENGL, f90gl: how to use glReadPixels ?

Intel_C_Intel
Employee
393 Views
Hello

I am using Compaq Visual Fortran 6.6C and the library f90gl (OPENGL). I would like to save pictures using the glReadPixels function. But I do not know how to declare the argument "pixels" of this function. I looked in openglglinterf.f90 and found the following function:
interface
subroutine f9y0glreadpixels(x,y,width,height,format,xtype,pixels,length)
use opengl_kinds
integer(kind=glint) ,intent(in) :: x, y
integer(kind=glsizei) ,intent(in) :: width, height
integer(kind=glenum) ,intent(in) :: format, xtype
integer(kind=glint), dimension(*), intent(out) :: pixels
integer(kind=glint) ,intent(in) :: length
end subroutine f9y0glreadpixels
end interface

But when I try to declare the same way the variable "pixels" in my program, the compiler tells me :
K:OpenGLEssaiGLEssaiGL.f90(69) : Error: This array name is invalid in this context. [IMAGE]
integer(kind=glint), dimension(*), intent(out) :: image
------------------------------------------------------------------^
K:OpenGLEssaiGLEssaiGL.f90(69) : Error: The assumed-size array must be a dummy argument. [IMAGE]
integer(kind=glint), dimension(*), intent(out) :: image

This is an excerpt of my code :
SUBROUTINE simulation()
USE opengl_gl
USE opengl_glut

integer(kind=glint), dimension(*), intent(out) :: image
INTEGER(KIND=GLint) :: x0,y0
INTEGER(KIND=GLsizei) :: l,h

x0=0
y0=0
l=100
h=100
...
...
CALL f9y0glReadPixels(x0,y0,l,h,GL_RGB,GL_UNSIGNED_BYTE,image);

END SUBROUTINE simulation

Does someone have a solution ?
Thank you
Vincent

Message Edited by vincent.magnin@libertysurf.fr on 04-07-2005 03:26 AM

0 Kudos
0 Replies
Reply