<class_name>typename create_object<class_name>(); The function creates the object of class <class_name> and returns its identifier.
void destroy_object_<class_name>(<class_name>_typename id); The function destroys the object of class <class_name> with identifier id.
The access to variable of <class_name>_typename has to be made through the operator &. Example: A a; a&x = 5; B b[5]; b[1]&y = 6.
The keyboard keys have type cmple_keyboard_key and defined in form KB_<key>. Example: KB_SPACE.
bool keyboard(cmple_keyboard_key key); The function returns if the key is pressed.
bool keyboard_pressed(cmple_keyboard_key key); The function returns if the key was currently pressed.
bool keyboard_released(cmple_keyboard_key key); The function returns if the key was currently released.
The mouse buttons have type cmple_mouse_button and defined in form MB_<key>. Example: MB_LEFT.
bool mouse(cmple_mouse_button button); The function returns if the button is pressed.
bool mouse_pressed(cmple_mouse_button button); The function returns if the button was currently pressed.
bool mouse_released(cmple_mouse_button button); The function returns if the button was currently released.
int mouse_x(); The function returns the x coordinate of cursor in pixels relative to upper left corner of window.
int mouse_y(); The function returns the y coordinate of cursor in pixels relative to upper left corner of window.
void set_resolution(unsigned int width, unsigned int height); The function sets the sizes of window to width and height. The function has to be called in creation code or in Create function of class, whose object was created during creation code. Otherwise, the function will not change anything.
void set_window_name(std::string name); The function sets the title of window to name. The function has to be called in creation code or in create function of class, whose object was created during creation code. Otherwise, the function will not change anything.
void set_frame_per_second(double fps); The function sets the frame per second of program to fps. By default the fps is 100.
void end_program(); The function ends program at the end of current iteration. Important: this function does not call Destroy function of objects.
void set_camera_position_by_look_at(float posX, float posY, float posZ, float targetX, float targetY, float targetZ); The function sets the position of camera such that it is in point (posX, posY, posZ), looks at point (targetX, targetY, targetZ) and its upper vector is (0, 1, 0).
void set_camera_position_by_angles(float posX, float posY, float posZ, float upX, float upY, float upZ, float yaw, float pitch); The function sets the position of camera such that it is in point (posX, posY, posZ), has upper vector (upX, upY, upZ) and corresponding pitch and yaw. The pitch and yaw are measured in degrees.
void set_exposure(float exposure); The function sets the exposure of light. By default it is recommended to use exposure = 1. The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void set_directional_light_direction(float dirX, float dirY, float dirZ); The function sets the direction of directional light to (dirX, dirY, dirZ). The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void set_directional_light_color(float colorRed, float colorGreen, float colorBlue); The function sets the color of directional light to (colorRed, colorGreen, colorBlue). The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void set_point_light_position(int index, float posX, float posY, float posZ); The function sets the position of point light with corresponding index to (posX, posY, posZ). The index has to be from 0 to 15. The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void set_point_light_color(int index, float colorRed, float colorGreen, float colorBlue); The function sets the color of point light with corresponding index to (colorRed, colorGreen, colorBlue). The index has to be from 0 to 15. The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void set_spot_light_position(float posX, float posY, float posZ); The function sets the position of spot light to (posX, posY, posZ). The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void set_spot_light_color(float colorRed, float colorGreen, float colorBlue); The function sets the color of spot light to (colorRed, colorGreen, colorBlue). The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void set_spot_light_direction(float dirX, float dirY, float dirZ); The function sets the direction of spot light to (dirX, dirY, dirZ). The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void set_spot_light_angle(float angleInner, float angleOuter); The function sets the angle of full intensity of spot light to angleInner and angle of decreasing from full to zero intensity to angleOuter. The angleInner and angleOuter are measured in degrees. The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
The font have type cmple_font and defined in form FT_<font>. Only 3 fonts are available:
- FT_ARIAL
- FT_CALIBRI
- FT_TIMES_NEW_ROMAN
void draw_text(std::string text, cmple_font font, float posX, float posY, float rotateAngle, float scaleX, float sizeY, float colorRed, float colorGreen, float colorBlue); The function renders the given text, using given font, in point (posX, posY), rotated to rotateAngle, scaled width to scaleX, with size sizeY, relatively to upper left corner, with color (colorRed, colorGreen, colorBlue). The rotateAngle is measured in degrees. The function has to be called in Draw2D function of class. Otherwise, the function will not change anything.
void draw_sprite(Sprite sprite, float posX, float posY, float rotateAngle, float scaleX, float scaleY, float colorRed, float colorGreen, float colorBlue); The function renders the given sprite, in point (posX, posY), rotated to rotateAngle, scaled to (scaleX, scaleY), relatively to upper left corner, with color (colorRed, colorGreen, colorBlue). The rotateAngle is measured in degrees. The function has to be called in Draw2D function of class. Otherwise, the function will not change anything.
void draw_model(Model model, float posX, float posY, float posZ, float rotateAngle, float rotateX, float rotateY, float rotateZ, float scaleX, float scaleY, float scaleZ); The function renders the given model, in point (posX, posY, posZ), rotated to rotateAngle relative to axis (rotateX, rotateY, rotate), scaled to (scaleX, scaleY, scaleZ). The rotateAngle is measured in degrees. The function has to be called in Draw3D function of class. Otherwise, the function will not change anything.
void sound_play(Sound sound); The function plays the sound.
void sound_stop(Sound sound); The function stops the sound.
bool sound_is_playing(Sound sound); The function returns if the sound is playing.