LMMS
Loading...
Searching...
No Matches

Topics

 Setup
 Frame
 Window
 Graphics
 Interaction

Macros

#define PUGL_NUM_VIEW_HINTS   ((unsigned)PUGL_REFRESH_RATE + 1u)
 The number of PuglViewHint values.
#define PUGL_NUM_SIZE_HINTS   ((unsigned)PUGL_MAX_ASPECT + 1u)
 The number of PuglSizeHint values.

Typedefs

typedef struct PuglViewImpl PuglView
 A drawable region that receives events.
typedef struct PuglBackendImpl PuglBackend
typedef uintptr_t PuglNativeView
typedef voidPuglHandle
 Handle for a view's opaque user data.
typedef PuglStatus(* PuglEventFunc) (PuglView *view, const PuglEvent *event)
 A function called when an event occurs.

Enumerations

enum  PuglViewHint {
  PUGL_USE_COMPAT_PROFILE , PUGL_USE_DEBUG_CONTEXT , PUGL_CONTEXT_VERSION_MAJOR , PUGL_CONTEXT_VERSION_MINOR ,
  PUGL_RED_BITS , PUGL_GREEN_BITS , PUGL_BLUE_BITS , PUGL_ALPHA_BITS ,
  PUGL_DEPTH_BITS , PUGL_STENCIL_BITS , PUGL_SAMPLES , PUGL_DOUBLE_BUFFER ,
  PUGL_SWAP_INTERVAL , PUGL_RESIZABLE , PUGL_IGNORE_KEY_REPEAT , PUGL_REFRESH_RATE
}
 A hint for configuring a view. More...
enum  PuglViewHintValue { PUGL_DONT_CARE = -1 , PUGL_FALSE = 0 , PUGL_TRUE = 1 }
 A special view hint value. More...
enum  PuglSizeHint {
  PUGL_DEFAULT_SIZE , PUGL_MIN_SIZE , PUGL_MAX_SIZE , PUGL_FIXED_ASPECT ,
  PUGL_MIN_ASPECT , PUGL_MAX_ASPECT
}

Detailed Description

A drawable region that receives events.

A view can be thought of as a window, but does not necessarily correspond to a top-level window in a desktop environment. For example, a view can be embedded in some other window, or represent an embedded system where there is no concept of multiple windows at all.

Macro Definition Documentation

◆ PUGL_NUM_SIZE_HINTS

#define PUGL_NUM_SIZE_HINTS   ((unsigned)PUGL_MAX_ASPECT + 1u)

The number of PuglSizeHint values.

◆ PUGL_NUM_VIEW_HINTS

#define PUGL_NUM_VIEW_HINTS   ((unsigned)PUGL_REFRESH_RATE + 1u)

The number of PuglViewHint values.

Typedef Documentation

◆ PuglBackend

typedef struct PuglBackendImpl PuglBackend

A graphics backend.

The backend dictates how graphics are set up for a view, and how drawing is performed. A backend must be set by calling puglSetBackend() before realising a view.

If you are using a local copy of Pugl, it is possible to implement a custom backend. See the definition of PuglBackendImpl in the source code for details.

◆ PuglEventFunc

typedef PuglStatus(* PuglEventFunc) (PuglView *view, const PuglEvent *event)

A function called when an event occurs.

◆ PuglHandle

typedef void* PuglHandle

Handle for a view's opaque user data.

◆ PuglNativeView

typedef uintptr_t PuglNativeView

A native view handle.

X11: This is a Window.

MacOS: This is a pointer to an NSView*.

Windows: This is a HWND.

◆ PuglView

typedef struct PuglViewImpl PuglView

A drawable region that receives events.

Enumeration Type Documentation

◆ PuglSizeHint

A hint for configuring/constraining the size of a view.

The system will attempt to make the view's window adhere to these, but they are suggestions, not hard constraints. Applications should handle any view size gracefully.

Enumerator
PUGL_DEFAULT_SIZE 

Default size.

PUGL_MIN_SIZE 

Minimum size.

PUGL_MAX_SIZE 

Maximum size.

PUGL_FIXED_ASPECT 

Fixed aspect ratio.

If set, the view's size should be constrained to this aspect ratio. Mutually exclusive with PUGL_MIN_ASPECT and PUGL_MAX_ASPECT.

PUGL_MIN_ASPECT 

Minimum aspect ratio.

If set, the view's size should be constrained to an aspect ratio no lower than this. Mutually exclusive with PUGL_FIXED_ASPECT.

PUGL_MAX_ASPECT 

Maximum aspect ratio.

If set, the view's size should be constrained to an aspect ratio no higher than this. Mutually exclusive with PUGL_FIXED_ASPECT.

◆ PuglViewHint

A hint for configuring a view.

Enumerator
PUGL_USE_COMPAT_PROFILE 

Use compatible (not core) OpenGL profile.

PUGL_USE_DEBUG_CONTEXT 

True to use a debug OpenGL context.

PUGL_CONTEXT_VERSION_MAJOR 

OpenGL context major version.

PUGL_CONTEXT_VERSION_MINOR 

OpenGL context minor version.

PUGL_RED_BITS 

Number of bits for red channel.

PUGL_GREEN_BITS 

Number of bits for green channel.

PUGL_BLUE_BITS 

Number of bits for blue channel.

PUGL_ALPHA_BITS 

Number of bits for alpha channel.

PUGL_DEPTH_BITS 

Number of bits for depth buffer.

PUGL_STENCIL_BITS 

Number of bits for stencil buffer.

PUGL_SAMPLES 

Number of samples per pixel (AA).

PUGL_DOUBLE_BUFFER 

True if double buffering should be used.

PUGL_SWAP_INTERVAL 

Number of frames between buffer swaps.

PUGL_RESIZABLE 

True if view should be resizable.

PUGL_IGNORE_KEY_REPEAT 

True if key repeat events are ignored.

PUGL_REFRESH_RATE 

Refresh rate in Hz.

◆ PuglViewHintValue

A special view hint value.

Enumerator
PUGL_DONT_CARE 

Use best available value.

PUGL_FALSE 

Explicitly false.

PUGL_TRUE 

Explicitly true.