NASM Forum > Programming with NASM

glutBitmapString in x86_64 linux

(1/1)

Rodrigo Robles:
I'm trying glutBitmapString, but I'm doing something wrong to get the external symbol GLUT_BITMAP_HELVETICA_18 (or any other gl font). Call opengl functions is pretty easy, with wrt ..plt sufix, but for glutBitMapString needs the font parameter, wich is the external symbol.

GLUT_BITMAP_HELVETICA_18 is defined in freeglut.h as


--- Code: ---#   define  GLUT_BITMAP_HELVETICA_18        ((void *) &glutBitmapHelvetica18)

--- End code ---

and glutBitmapHelvetica18 is defined as


--- Code: ---extern void* glutBitmapHelvetica18;
--- End code ---

To get glutBitmapHelvetica18 I tried:


--- Code: ---extern glutBitmapHelvetica18

lea rdi, [rel glutBitmapHelvetica18 wrt ..gotpc]

--- End code ---

But it gives a "font 0x00405ff8 not found"

What would be the right way to get this external symbol from freeglut?

Frank Kotler:
https://forum.nasm.us/index.php?topic=2634.0

Any help? Maybe not...

Best,
Frank

Rodrigo Robles:

--- Quote from: Frank Kotler on November 02, 2021, 02:06:15 AM ---https://forum.nasm.us/index.php?topic=2634.0

Any help? Maybe not...

Best,
Frank



--- End quote ---

That thread was my starting point for opengl with x86_64 Linux.

The program I'm working on nowadays uses dozens of differente gl/glu/glut functions and have more than a thousand lines.

The problem is specifically in the use of glutBitmapString and access the external symbol GLUT_BITMAP_HELVETICA_18. The sintax with rel and ..gotpc should do the trick, but doesn't work.

Navigation

[0] Message Index

Go to full version