[GOODIE] OpenGL for Squeak
Raab, Andreas
Andreas.Raab at disney.com
Tue Oct 31 19:01:52 UTC 2000
Very cool! BTW, from the page:
PFNGLADDSWAPHINTRECTWINPROC p = (PFNGLADDSWAPHINTRECTWINPROC)
wglGetProcAddress("glAddSwapHintRectWIN");
(*p)(Lx, Ly, Rx, Ry); // Suggests area to swap
This code asks OpenGL not to swap the whole buffer but only that covered by
the morph. Such a request is an extension to OpenGL so a pointer to it must
be requested. How would you do this with squeaks FFI?
wglGetProcAddress: aString
<apicall: void* 'wglGetProcAddressA' (char*)>
^self externalCallFailed
and now...
| myHandle |
myHandle := OpenGL wglGetProcAddress: 'glAddSwapHintRectWIN'.
"Check myHandle to see if its NULL here."
"Ignore function and module name below"
myFunction := ExternalLibraryFunction name: '' module: ''
callType: 1 /* api call */
returnType: ExternalType bool
argumentTypes: ((1 to: 4) collect:[:i| ExternalType long]).
myFunction setHandle: myHandle getHandle. "install function pointer
directly"
myFunction invokeWith: 0 with: 0 with: 100 with: 100.
- Andreas
> -----Original Message-----
> From: Wiebe Baron [mailto:wiebe at cosmocows.com]
> Sent: Tuesday, October 31, 2000 7:23 AM
> To: squeak at cs.uiuc.edu
> Cc: recipient list not shown
> Subject: [GOODIE] OpenGL for Squeak
>
>
> Hi everyone,
> Here's hardware acceleration in squeak with OpenGL:
>
> www.cosmocows.com/OpenGL/
>
> Afraid it only runs on windows (feel free to port it elsewhere)!
> This is a work in progress, I'm still exploring Squeak (and OpenGL).
> The page includes a description, example code, a list of
> bugs, limitations
> and questions.
>
> The big question:How about OpenGL in the VM under balloon?
>
> Enjoy,
> Wiebe.
>
More information about the Squeak-dev
mailing list
|