NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: Rodrigo Robles on November 02, 2021, 12:08:30 AM

Title: glutBitmapString in x86_64 linux
Post by: Rodrigo Robles on November 02, 2021, 12:08:30 AM
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: [Select]
#   define  GLUT_BITMAP_HELVETICA_18        ((void *) &glutBitmapHelvetica18)

and glutBitmapHelvetica18 is defined as

Code: [Select]
extern void* glutBitmapHelvetica18;
To get glutBitmapHelvetica18 I tried:

Code: [Select]
extern glutBitmapHelvetica18

lea rdi, [rel glutBitmapHelvetica18 wrt ..gotpc]

But it gives a "font 0x00405ff8 not found"

What would be the right way to get this external symbol from freeglut?
Title: Re: glutBitmapString in x86_64 linux
Post by: 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

Title: Re: glutBitmapString in x86_64 linux
Post by: Rodrigo Robles on November 02, 2021, 07:18:27 PM
https://forum.nasm.us/index.php?topic=2634.0

Any help? Maybe not...

Best,
Frank



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.