
|
|
This file was automatically generated from diguy_graphics_ogl.h. Do not edit this file directly; the changes will be lost.Includes: diguy_api.h | graphics_init_ogl.h | declspec_diguy_graphics.h
Contents:
Link against: libdiguy_graphics_ogl
| Functions |
function diguy_ogl_initialize |
Prototype:
Description:diguy_ogl_initialize(bdiGraphicsInitOgl* init);
This function initializes the DI-Guy Runtime API for the OpenGL environment.This function should only be called once per program execution.
Do not call this function again, even after calling
diguy_deinitialize().
Use diguy_ogl_get_defaults() to fill out the init structure before changing specific entries.Arguments:
Returns:
init pointer to type bdiGraphicsInitOgl; passing NULL will cause defaults to be used for all values
0 on success, non-zero error code on failure
Refer to diguy_constants.h for error code values.
function diguy_ogl_get_defaults |
Prototype:
Description:diguy_ogl_get_defaults(bdiGraphicsInitOgl* init);
Fills out the init structure with default values. Selected entries can then be changed before calling diguy_ogl_initialize().Arguments:
Returns:
init pointer to type bdiGraphicsInitOgl
0 on success, -1 on failure
function diguy_default_fire_weapon_intersection_function |
Prototype:
Description:int diguy_default_fire_weapon_intersection_function(diguyImpact* impact, float from_x, float from_y, float from_z, float to_x, float to_y, float to_z, diguyScenario* scenario);
This function is the default fire intersection function. It uses a minimal render of the scene and characters into the back buffer to fill out the impact structure.
It may be useful to combine your intersection results with the results from this function.
| Experimental Functions |
The following functions are experimental and may change or disappear with no warning.
function diguy_ogl_generate_character_texture_list |
Prototype:
Description:int diguy_ogl_generate_character_texture_list(diguyScenario* scenario, int character_index);
This function queries the character for the OpenGL texture objects it is using and stores them in an internal list. This internal list can then be accessed via the following functions:
diguy_ogl_get_character_texture_list_num_textures(); diguy_ogl_get_character_texture_list_texture_object_at_index(); diguy_ogl_get_character_texture_list_texture_filename_at_index();The function diguy_ogl_release_character_texture_list() should be called once query calls are complete to avoid a resource leak.
Note that there is currently only one internal texture list; there are not separate lists per character. Calling this function again, even with a different scenario pointer and/or character index, will clobber the previous texture list.Arguments:
Returns:
scenario pointer to character's scenario character_index index of character to be queried
0 on success, -1 on failureC++ Example:
diguy_ogl_generate_character_texture_list(scenario, character_index); int texture_count = diguy_ogl_get_character_texture_list_num_textures(scenario, character_index); if (texture_count > 0) { int texture_index; for (texture_index = 0; texture_index < texture_count; texture_index++) { GLuint texture_object = diguy_ogl_get_character_texture_list_texture_object_at_index(scenario, character_index, texture_index); const char* texture_filename = diguy_ogl_get_character_texture_list_texture_filename_at_index(scenario, character_index, texture_index); bdi_log_printf(BDI_LOG_WARN, "\ttexture object = %ld, filename = %s\n", texture_object, texture_filename); } GLuint texture_object = diguy_ogl_get_character_texture_list_texture_object_at_index(scenario, character_index, 0); // the first texture in the list // // (Code to override/replace the texture) // diguy_ogl_set_character_texture_objects_modified(scenario, character_index); diguy_ogl_release_character_texture_list(scenario, character_index); }
function diguy_ogl_release_character_texture_list |
Prototype:
Description:int diguy_ogl_release_character_texture_list(diguyScenario* scenario, int character_index);
This function releases a texture list generated by diguy_ogl_generate_character_texture_list().Arguments:
Returns:
scenario pointer to character's scenario character_index index of character to be queried
0 on success, -1 on failure
function diguy_ogl_get_character_texture_list_num_textures |
Prototype:
Description:int diguy_ogl_get_character_texture_list_num_textures(diguyScenario* scenario, int character_index);
This function returns the number of textures used by the specified character.
The function diguy_ogl_generate_character_texture_list() must be called before this function. The scenario and character_index arguments passed to this function must match those passed to the generate function.Arguments:
Returns:
scenario pointer to character's scenario character_index index of character to be queried
number of textures in texture list
function diguy_ogl_get_character_texture_list_texture_object_at_index |
Prototype:
Description:GLuint diguy_ogl_get_character_texture_list_texture_object_at_index(diguyScenario* scenario, int character_index, int texture_list_index);
This function returns the OpenGL texture object at the specified index.
The function diguy_ogl_generate_character_texture_list() must be called before this function. The scenario and character_index arguments passed to this function must match those passed to the generate function.Arguments:
Returns:
scenario pointer to character's scenario character_index index of character to be queried texture_list_index index of texture in texture list
OpenGL texture object
function diguy_ogl_get_character_texture_list_texture_filename_at_index |
Prototype:
Description:const char* diguy_ogl_get_character_texture_list_texture_filename_at_index(diguyScenario* scenario, int character_index, int texture_list_index);
This function returns the filename of the texture at the specified index.
The function diguy_ogl_generate_character_texture_list() must be called before this function. The scenario and character_index arguments passed to this function must match those passed to the generate function.Arguments:
Returns:
scenario pointer to character's scenario character_index index of character to be queried texture_list_index index of texture in texture list
filename of the texture
function diguy_ogl_set_character_texture_objects_modified |
Prototype:
Description:int diguy_ogl_set_character_texture_objects_modified(diguyScenario* scenario, int character_index);
This function notifies the character that its texture objects have been modified and that it should take any steps necessary to update its internal state to ensure proper display.Arguments:
Returns:
scenario pointer to character's scenario character_index index of character to be queried
0 on success, -1 on failure
function diguy_ogl_get_texture_unit |
Prototype:
Description:int diguy_ogl_get_texture_unit();
This function returns the texture unit that DI-Guy is currently set to use.Returns:
integer identifying texture unit; e.g., 0 for texture unit 0
function diguy_ogl_set_texture_unit |
Prototype:
Description:int diguy_ogl_set_texture_unit(int texture_unit);
This function sets the texture unit that DI-Guy should use.Arguments:
texture_unit integer identifying texture unit Possible values are:
Returns:
0 use GL_TEXTURE0 1 use GL_TEXTURE1 2 use GL_TEXTURE2 3 use GL_TEXTURE3
0 on success, -1 on failure
function diguy_ogl_set_use_far_positions |
Prototype:
Description:void diguy_ogl_set_use_far_positions(int val);
This function turns far position rendering on or off. See diguyViewCamera for more information on far positions.Arguments:
val pass 1 to use far positions, 0 to not use them
function diguy_ogl_get_use_far_positions |
Prototype:
Returns:int diguy_ogl_get_use_far_positions();
1 if far positions are in use, else 0
function diguy_ogl_set_default_shader_source_files |
Prototype:
Description:void diguy_ogl_set_default_shader_source_files(const char* shader_name, const char* vert_filename, const char* pixel_filename);
This function sets the shader source files that will be used for the specified shader.
The default filenames for the "diguy_character" shader are "diguy_character_glsl.vert" and "diguy_character_glsl.frag".Arguments:
shader_name name with which vertex/pixel shader pair can be referenced vert_filename name of vertex shader source file pixel_filename name of pixel (fragment) shader source file
function diguy_ogl_render_shadow_map |
Prototype:
Description:int diguy_ogl_render_shadow_map(unsigned int texture_unit, // 0 to 7, not GL_TEXTURE0 to GL_TEXTURE7 diguyViewLight* light, diguyScenario* scenario, float pos_above_terrain);
Renders a shadow pass of the world and binds into the target texture unit.
function diguy_ogl_apply_active_lights |
Prototype:
Description:int diguy_ogl_apply_active_lights(diguyScenario* scenario);
Applies active lights to the OpenGL state, also updates default shader uniforms and calls diguyScenario::set_num_active_point_lights()
Returns:
The number of active lights
| Experimental Heads-Up Display Functions |
The following functions are experimental and may change or disappear with no warning.
function diguy_ogl_2d_set_color |
Prototype:
int diguy_ogl_2d_set_color(float r, float g, float b, float a);
function diguy_ogl_2d_draw_filled_rect |
Prototype:
int diguy_ogl_2d_draw_filled_rect(int x0, int y0, int x1, int y1);
function diguy_ogl_2d_draw_text |
Prototype:
int diguy_ogl_2d_draw_text(int x, int y, const char* text);
function diguy_ogl_2d_get_text_width |
Prototype:
int diguy_ogl_2d_get_text_width(const char* text);
function diguy_ogl_2d_get_text_height |
Prototype:
int diguy_ogl_2d_get_text_height(const char* text);
function diguy_ogl_get_fbo_texture_id |
Prototype:
int diguy_ogl_get_fbo_texture_id();
function diguy_ogl_reload_changed_textures |
Prototype:
int diguy_ogl_reload_changed_textures();
| Experimental frame stats API |
Currently available stats:
- "characters_drawn"
- "links_drawn"
- "shapes_drawn"
- "nodes_drawn"
- "mats_bound"
- "groups_drawn"
- "textures_bound"
- "vbos_drawn"
- "rigid_vbos_drawn",
- "skinned_vbos_drawn"
- "tris_drawn"
- "verts_drawn"
Stats should be cleared once a frame to get accurate results.
function diguy_ogl_get_num_frame_stats |
Prototype:
int diguy_ogl_get_num_frame_stats();
function diguy_ogl_frame_stat_name |
Prototype:
const char* diguy_ogl_frame_stat_name(int index);
function diguy_ogl_get_frame_stat |
Prototype:
int diguy_ogl_get_frame_stat(const char* stat_name);
function diguy_ogl_clear_all_frame_stats |
Prototype:
int diguy_ogl_clear_all_frame_stats();
function diguy_ogl_draw_frame_stats |
Prototype:
int diguy_ogl_draw_frame_stats(int sx, int sy);
ALL RIGHTS RESERVED.
These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.
Contractor/Manufacturer is:
Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.