[squeak-dev] OGLUnixX11LE >> glPixelStorei: with:

Beckmann, Tom Tom.Beckmann at student.hpi.uni-potsdam.de
Sat May 9 06:58:07 UTC 2020


Hi there!

Replacing the whole #openGLLibraryName method with a simple
^ 'GL'
should work, as long as you adapt your LD_LIBRARY_PATH to include the arch specific libraries. For example adding
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/"
in your squeak.sh before the vm gets started should make sure that the image finds libgl*. Of course, if your libgl.so.1 is not found under that path, adjust accordingly.

Alternatively, you can also specify the absolute path to the library, e.g.
^ '/usr/lib/x86_64-linux-gnu/libGL.so'
which may be a safer option to start from if you're having troubles getting it to run.

For the apicall:'s, if you inspect the byte codes of the method, you will in fact notice that is has already been replaced for you. This happens in OpenGL>>#privateInstallLibrary:, but only updates the method's bytecode, not its source code (which is good, because otherwise this would end up in commits or your changes file).

Best,
Tom
________________________________________
From: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> on behalf of gettimothy via Squeak-dev <squeak-dev at lists.squeakfoundation.org>
Sent: Friday, May 8, 2020 9:23:48 PM
To: squeak-dev
Subject: [squeak-dev] OGLUnixX11LE >> glPixelStorei: with:

Hi folks,

I am stepping through the OpenGL example, getting my head wrapped around it.

First thing is in OGLUnix openGLLibraryName I had to make a change for Smalltalke osVersion   to handle 'linux-gnu'.



openGLLibraryName
^((Smalltalk osVersion = 'linux') | (Smalltalk osVersion = 'linux-gnu'))
ifTrue: ['libGL.so.1']
ifFalse: ['GL']


All well and good.

Also, as pre-amble, I am able to set debug level via primitive call with:

OpenGL primitiveSetVerboseLevel:5
with no exception/error.



My immediate concern is in OGLUnixX11LE >> glPixelStorei:with:


glPixelStorei: pname with: param
"This method was automatically generated."
"void glPixelStorei(GLenum pname, GLint param);"
<apicall: void 'glPixelStorei' (ulong long) module: '#openGLLibraryName'>
^self externalCallFailed


That argument module:'#openGLLibraryName' smells like an error, as if it should have been replaced by something with   'libGL.so.1'

Well, I manually replaced it in that method with the same result.

I downloaded the latest FFI-Examples package and the FFI-Unix-Examples is empty, so I cannot infer from that.


Is there a way I can search the image for all the <apicall: pragmas ? I may be able to find one that works and start from there.

thanks in advance.







More information about the Squeak-dev mailing list