<commit_before># Copyright (C) 2008-2009, Parrot Foundation.
# $Id$

=head1 NAME

OpenGL - Parrot extension for OpenGL bindings

=head1 SYNOPSIS

This covers only the basic OpenGL and GLUT initialization.
For more, look in F<examples/opengl/>, starting with
F<examples/opengl/triangle.pir>.

 # Include OpenGL constants
 .include 'opengl_defines.pasm'

 .sub main :main
    .param pmc argv

    # Load OpenGL libary and a helper library for calling glutInit
    load_bytecode 'library/OpenGL.pbc'
    load_bytecode 'library/NCI/call_toolkit_init.pbc'

    # Import all OpenGL/GLU/GLUT functions
    .local pmc import_gl
    import_gl = get_global ['OpenGL'], '_export_all_functions'
    import_gl()

    # Initialize GLUT
    .local pmc call_toolkit_init
    call_toolkit_init = get_global ['NCI'], 'call_toolkit_init'

    .const .Sub glutInit = 'glutInit'
    argv = call_toolkit_init(glutInit, argv)

    # Set display mode, create GLUT window, save window handle
    .local int mode
    mode = .GLUT_DOUBLE | .GLUT_RGBA
    glutInitDisplayMode(mode)

    .local pmc window
    window = new 'Integer'
    window = glutCreateWindow('My Window Title')
    set_global 'glut_window', window

    # Set up GLUT callbacks
    .const .Sub draw     = 'draw'
    .const .Sub idle     = 'idle'
    .const .Sub keyboard = 'keyboard'
    glutDisplayFunc (draw)
    glutIdleFunc    (idle)
    glutKeyboardFunc(keyboard)

    # Enter the GLUT main loop
    glutMainLoop()
 .end

=head1 DESCRIPTION

This library is a straightforward Parrot NCI wrapper for OpenGL, GLU, and
GLUT.  It is still a work in progress; work will generally start with the
oldest, most widely supported functions and progress to the most recently
standardized calls.  Generally you will find programming GLUT in PIR to be
similar to GLUT in C -- for heavy drawing code, it is sometimes difficult
to tell the difference except for the leading period on PIR constant names
and lack of trailing semicolons on each line.
<commit_msg>[OpenGL] Fix old '.const .Sub' syntax in OpenGL.pir POD<commit_after># Copyright (C) 2008-2009, Parrot Foundation.
# $Id$

=head1 NAME

OpenGL - Parrot extension for OpenGL bindings

=head1 SYNOPSIS

This covers only the basic OpenGL and GLUT initialization.
For more, look in F<examples/opengl/>, starting with
F<examples/opengl/triangle.pir>.

 # Include OpenGL constants
 .include 'opengl_defines.pasm'

 .sub main :main
    .param pmc argv

    # Load OpenGL libary and a helper library for calling glutInit
    load_bytecode 'library/OpenGL.pbc'
    load_bytecode 'library/NCI/call_toolkit_init.pbc'

    # Import all OpenGL/GLU/GLUT functions
    .local pmc import_gl
    import_gl = get_global ['OpenGL'], '_export_all_functions'
    import_gl()

    # Initialize GLUT
    .local pmc call_toolkit_init
    call_toolkit_init = get_global ['NCI'], 'call_toolkit_init'

    .const 'Sub' glutInit = 'glutInit'
    argv = call_toolkit_init(glutInit, argv)

    # Set display mode, create GLUT window, save window handle
    .local int mode
    mode = .GLUT_DOUBLE | .GLUT_RGBA
    glutInitDisplayMode(mode)

    .local pmc window
    window = new 'Integer'
    window = glutCreateWindow('My Window Title')
    set_global 'glut_window', window

    # Set up GLUT callbacks
    .const 'Sub' draw     = 'draw'
    .const 'Sub' idle     = 'idle'
    .const 'Sub' keyboard = 'keyboard'
    glutDisplayFunc (draw)
    glutIdleFunc    (idle)
    glutKeyboardFunc(keyboard)

    # Enter the GLUT main loop
    glutMainLoop()
 .end

=head1 DESCRIPTION

This library is a straightforward Parrot NCI wrapper for OpenGL, GLU, and
GLUT.  It is still a work in progress; work will generally start with the
oldest, most widely supported functions and progress to the most recently
standardized calls.  Generally you will find programming GLUT in PIR to be
similar to GLUT in C -- for heavy drawing code, it is sometimes difficult
to tell the difference except for the leading period on PIR constant names
and lack of trailing semicolons on each line.

{'fraction_non_alphanumeric': 0.07121588089330025, 'fraction_numerical': 0.005459057071960298, 'mean_word_length': 3.4988839285714284, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4207873', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1229, 'n_words': 466}