Menu

#29 glpRasterFont version for glut missing

POGL 0.xx
wont-fix
nobody
None
5
2025-05-11
2024-12-17
No

When using glut instead of x11 backend and trying to do:

my $win = PDL::Graphics::TriD::get_current_window();
$lb = $win->glpRasterFont("8x16",0,255); # should be name, base, number, X11::Display*
OpenGL::glpPrintString($lb, "hello");

Then it crashes on glpRasterFont because display is not set.

I suggest to allow an unset display or something and then do something like this in the glut case:

sub glpRasterFont:

  • if ( !$display ) {
  • my $base = OpenGL::glGenLists(128);
  • for my $i (0..128) {
  • OpenGL::glNewList($base + $i, OpenGL::GL_COMPILE);
  • OpenGL::glutBitmapCharacter(OpenGL::GLUT_BITMAP_8_BY_13, $i);
  • OpenGL::glEndList();
  • }
  • $base;

Or maybe pass the window_type explicitly?

This could also be worked around in pdl instead.

Discussion

  • mohawk

    mohawk - 2024-12-18

    Thank you for the report!

    Please could I ask you to open an issue on https://github.com/Perl-GPU/pogl/issues and close this?

    A pull-request to fix it would be extremely welcome, of course. And PDL's TriD interface is now an independent CPAN release, with its repo at https://github.com/PDLPorters/PDL-Graphics-TriD if you wanted to instead open an issue there.

    I think the ideal solution is to both have OpenGL not crash on that input, and maybe do the right thing, and if TriD needs to change its ways, to change that also.

     
  • mohawk

    mohawk - 2025-05-11

    As of 2.102, PDL::Graphics::TriD no longer uses the glpRasterFont functionality; gl_texts calls into a vendored version of GLUT's Helvetica font.

    glpRasterFont was always a GLX -only function.

     
  • mohawk

    mohawk - 2025-05-11
    • status: open --> wont-fix
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.