MyGL
Loading...
Searching...
No Matches
my Namespace Reference

Namespace containing every class, function and enum of the library. More...

Classes

class  AbstractShape
 Class inherited by all the shapes, it defines common operations on a shape. More...
 
class  Camera
 Class used to manipulate a 2D camera. More...
 
class  Color
 Class for storing color objects. More...
 
class  Cursor
 A class for storing custom cursors. More...
 
struct  Event
 Struct for representing events and informations associated with them. More...
 
class  Font
 Class for storing a font. More...
 
class  Image
 A class for manipulating imges. More...
 
struct  MouseInfo
 Mouse informations for events involving mouse buttons. More...
 
class  Polygon
 Class for creating regular polygons of 3 or more sides. More...
 
class  Rectangle
 Class for creating rectangles. More...
 
class  Shader
 Class for storing a shader. More...
 
class  ShaderProgram
 Class for creating shader programs. More...
 
class  Text
 Class for drawing strings of text. More...
 
class  Texture
 Class for storing textures. More...
 
class  Triangle
 Class for creating triangles. More...
 
class  Window
 Class for creating a window. More...
 

Enumerations

enum class  EventType {
  keyPressed , keyReleased , keyRepeated , mouseMoved ,
  mouseButtonPressed , mouseButtonReleased , mouseScrolled , cursorEntered ,
  cursorLeft , windowResized , windowShouldClose , unknown
}
 Types that an event can have. More...
 
enum class  Key {
  unknown = -1 , space = 32 , apostrophe = 39 , comma = 44 ,
  minus , period , slash , n0 ,
  n1 , n2 , n3 , n4 ,
  n5 , n6 , n7 , n8 ,
  n9 , semicolon = 59 , equal = 61 , a = 65 ,
  b , c , d , e ,
  f , g , h , i ,
  j , k , l , m ,
  n , o , p , q ,
  r , s , t , u ,
  v , w , x , y ,
  z , left_bracket , backslash , right_bracket ,
  grave_accent = 96 , non_us1 = 161 , non_us2 , escape = 256 ,
  enter , tab , backspace , insert ,
  del , right , left , down ,
  up , page_up , page_down , home ,
  end , caps_lock = 280 , scroll_lock , num_lock ,
  print_screen , pause , f1 = 290 , f2 ,
  f3 , f4 , f5 , f6 ,
  f7 , f8 , f9 , f10 ,
  f11 , f12 , f13 , f14 ,
  f15 , f16 , f17 , f18 ,
  f19 , f20 , f21 , f22 ,
  f23 , f24 , f25 , np0 = 320 ,
  np1 , np2 , np3 , np4 ,
  np5 , np6 , np7 , np8 ,
  np9 , np_dot , np_divide , np_multiply ,
  np_substract , np_add , np_enter , np_equal ,
  left_shift = 340 , left_ctrl , left_alt , left_os ,
  right_shift , right_ctrl , right_alt , right_os ,
  menu
}
 Key codes for every key of a fullsize US qwerty layout. More...
 
enum class  MouseButton {
  left , right , middle , extra_1 ,
  extra_2 , extra_3 , extra_4 , extra_5 ,
  none
}
 Codes for mouse buttons (used in mouseButtonPressed / Released events) More...
 
enum  WindowFlag : unsigned int {
  none = 0 , resizable = 1 << 0 , floating = 1 << 1 , transparent = 1 << 2 ,
  maximized = 1 << 3
}
 Flags passed when creating a window to change its behaviour. More...
 

Detailed Description

Namespace containing every class, function and enum of the library.

Enumeration Type Documentation

◆ EventType

enum class EventType
strong

Types that an event can have.

Enumerator
keyPressed 

Event triggered when a key is pressed.

This event is triggered when a keyboard key (including modifier keys) has been pressed. It will set the event.type to keyPressed, event.keyCode to the corresponding key code and provide information about the modifier keys' state

keyReleased 

Event triggered when a key is released.

This event is triggered when a keyboard key (including modifier keys) was pressed and has been released. It will set the event.type to keyReleased, event.keyCode to the corresponding key code and provide information about the modifier keys' state

keyRepeated 

Event triggered when a key is held down.

This event is triggered when a keyboard key (including modifier keys) is held down longer than the os' repeat delay, and it is triggered until the key is released. It will set the event.type to keyRepeated, event.keyCode to the corresponding key code and provide information about the modifier keys' state

mouseMoved 

Event triggered when the mouse cursor moves inside the window.

This event is triggered when the cursor's position changes. It sets event.type to mouseMoved, event.mouse.pos to the new x and y positions relative to the window's bottom left corner, and does not provide information about the modifier keys

mouseButtonPressed 

Event triggered when a mouse button is pressed.

This event is triggered when a mouse button has been pressed. It sets event.type to mouseButtonPressed, event.mouseButton to one of 'left', 'right' or 'middle' for traditionnal mouse buttons, and one of 'extra_1' to 'extra_5' for additional mouse buttons. It provides information about the modifier keys' state

mouseButtonReleased 

Event triggered when a mouse button is released.

This event is triggered when a mouse button is released after being pressed. It sets event.type to mouseButtonReleased, event.mouseButton to one of 'left', 'right' or 'middle' for traditionnal mouse buttons, and one of 'extra_1' to 'extra_5' for additional mouse buttons. It provides information about the modifier keys' state

mouseScrolled 

Event triggered when scrolling (mouse wheel movement or touchpad gesture)

This event is triggered when the mouse wheel has been scrolled or a touchpad scrolling gesture happened. It sets event.type to mouseScrolled, event.scrollOffset to the number of ticks that has been scrolled verticaly (y) and horizontaly (x). It does not provide information about the modifier keys

cursorEntered 

Event triggered when the cursor enters the window's content area.

This event is triggered when the cursor enters the window's content area. It sets event.type to cursorEntered, event.keyCode to unknown as it does not provide any additional informations, and does not give information about the modifier keys

cursorLeft 

Event triggered when the cursor leaves the window's content area.

This event is triggered when the cursor leaves the window's content area. It sets event.type to cursorLeft, event.keyCode to unknown as it does not provide any additional informations, and does not give information about the modifier keys

windowResized 

Event triggered when the window is resized.

windowShouldClose 

Event triggered when the user tries to close the window.

unknown 

Special value used to signal that an event variable is not associated to any event.

Definition at line 14 of file Event.hpp.

◆ Key

enum class Key
strong

Key codes for every key of a fullsize US qwerty layout.

The my::Key enum is used in keyboard events to indicate the involved key, the keys correspond to the ones of a full size US layout keyboard.

  • Keys situated on the number pad have the 'np' prefix. ('np0' to 'np9', 'np_divide', ...)
  • Duplicated keys such as alt or shift are prefixed with their location (e.g. 'left_shift', 'right_alt').
  • Function keys have the 'f' prefix ('f1', f2', ...)
  • Number keys of the main area have the 'n' prefix ('n0' to 'n9')

Definition at line 131 of file Event.hpp.

◆ MouseButton

enum class MouseButton
strong

Codes for mouse buttons (used in mouseButtonPressed / Released events)

Definition at line 259 of file Event.hpp.

◆ WindowFlag

enum WindowFlag : unsigned int

Flags passed when creating a window to change its behaviour.

Enumerator
resizable 

Makes the window resizable.

floating 

Keeps the window on top of other windows.

transparent 

Allows the framebuffer to be transparent, this means that calling window.clear() with a color whose aplha value is below 255 will result in a transparent background (the opacity will depend on the alpha value)

maximized 

Maximizes the window when created.

Definition at line 26 of file Window.hpp.