newLISP Fan Club

Forum => newLISP Graphics & Sound => Topic started by: ant on October 24, 2011, 02:36:26 PM

Title: glDrawPixels possible?
Post by: ant on October 24, 2011, 02:36:26 PM
Is it possible to use glDrawPixels from a newLISP script? I want to display an image I've constructed in an array of RGB values.



If it is possible, could you point me to the documentation or an example?



If it isn't possible, am I trying to do something newLISP is not designed for?
Title: Re: glDrawPixels possible?
Post by: Lutz on October 25, 2011, 12:13:50 AM
Here is an example how to import functions from OpenGL:

http://www.newlisp.org/syntax.cgi?downloads/OpenGL/opengl-demo-lsp.txt



It does not contain the glPixelDraw import, but shows how to import other functions and how to setup a window to draw in.



For the data in const GLvoid * data, you would use a string buffer produced with the 'pack' function

from the data points. Depending on the data type specified in GLenum type, you would use the correct

formatting character in 'pack'.



See also:

http://www.newlisp.org/downloads/newlisp_manual.html#import



and:

http://www.newlisp.org/downloads/CodePatterns.html#toc-23
Title: Re: glDrawPixels possible?
Post by: ant on October 25, 2011, 12:39:34 PM
Hi Lutz, Thanks for the info. I'm trying it now but I haven't succeeded in getting anything on the screen yet. I'll keep at it. Ant