Author Topic: glutBitmapString in x86_64 linux  (Read 10400 times)

Offline Rodrigo Robles

  • Jr. Member
  • *
  • Posts: 10
glutBitmapString in x86_64 linux
« 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?
« Last Edit: November 10, 2021, 12:04:06 AM by Rodrigo Robles »

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: glutBitmapString in x86_64 linux
« Reply #1 on: November 02, 2021, 02:06:15 AM »
https://forum.nasm.us/index.php?topic=2634.0

Any help? Maybe not...

Best,
Frank


Offline Rodrigo Robles

  • Jr. Member
  • *
  • Posts: 10
Re: glutBitmapString in x86_64 linux
« Reply #2 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.