LMMS
Loading...
Searching...
No Matches
Setup

Functions

PUGL_API PuglViewpuglNewView (PuglWorld *world)
PUGL_API void puglFreeView (PuglView *view)
 Free a view created with puglNewView().
PUGL_API PuglWorldpuglGetWorld (PuglView *view)
 Return the world that View is a part of.
PUGL_API void puglSetHandle (PuglView *view, PuglHandle handle)
PUGL_API PuglHandle puglGetHandle (PuglView *view)
 Get the user data for a view.
PUGL_API PuglStatus puglSetBackend (PuglView *view, const PuglBackend *backend)
const PuglBackendpuglGetBackend (const PuglView *view)
 Return the graphics backend used by a view.
PUGL_API PuglStatus puglSetEventFunc (PuglView *view, PuglEventFunc eventFunc)
 Set the function to call when an event occurs.
PUGL_API PuglStatus puglSetViewHint (PuglView *view, PuglViewHint hint, int value)
PUGL_API int puglGetViewHint (const PuglView *view, PuglViewHint hint)
PUGL_API double puglGetScaleFactor (const PuglView *view)

Detailed Description

Functions for creating and destroying a view.

Function Documentation

◆ puglFreeView()

PUGL_API void puglFreeView ( PuglView * view)

Free a view created with puglNewView().

◆ puglGetBackend()

const PuglBackend * puglGetBackend ( const PuglView * view)

Return the graphics backend used by a view.

◆ puglGetHandle()

PUGL_API PuglHandle puglGetHandle ( PuglView * view)

Get the user data for a view.

◆ puglGetScaleFactor()

PUGL_API double puglGetScaleFactor ( const PuglView * view)

Return the scale factor of the view.

This factor describe how large UI elements (especially text) should be compared to "normal". For example, 2.0 means the UI should be drawn twice as large.

"Normal" is loosely defined, but means a good size on a "standard DPI" display (around 96 DPI). In other words, the scale 1.0 should have text that is reasonably sized on a 96 DPI display, and the scale 2.0 should have text twice that large.

◆ puglGetViewHint()

PUGL_API int puglGetViewHint ( const PuglView * view,
PuglViewHint hint )

Get the value for a view hint.

If the view has been realized, this can be used to get the actual value of a hint which was initially set to PUGL_DONT_CARE, or has been adjusted from the suggested value.

◆ puglGetWorld()

PUGL_API PuglWorld * puglGetWorld ( PuglView * view)

Return the world that View is a part of.

◆ puglNewView()

PUGL_API PuglView * puglNewView ( PuglWorld * world)

Create a new view.

A newly created view does not correspond to a real system view or window. It must first be configured, then the system view can be created with puglRealize().

◆ puglSetBackend()

PUGL_API PuglStatus puglSetBackend ( PuglView * view,
const PuglBackend * backend )

Set the graphics backend to use for a view.

This must be called once to set the graphics backend before calling puglRealize().

Pugl includes the following backends:

Note that backends are modular and not compiled into the main Pugl library to avoid unnecessary dependencies. To use a particular backend, applications must link against the appropriate backend library, or be sure to compile in the appropriate code if using a local copy of Pugl.

◆ puglSetEventFunc()

PUGL_API PuglStatus puglSetEventFunc ( PuglView * view,
PuglEventFunc eventFunc )

Set the function to call when an event occurs.

◆ puglSetHandle()

PUGL_API void puglSetHandle ( PuglView * view,
PuglHandle handle )

Set the user data for a view.

This is usually a pointer to a struct that contains all the state which must be accessed by a view. Everything needed to process events should be stored here, not in static variables.

The handle is opaque to Pugl and is not interpreted in any way.

◆ puglSetViewHint()

PUGL_API PuglStatus puglSetViewHint ( PuglView * view,
PuglViewHint hint,
int value )

Set a hint to configure view properties.

This only has an effect when called before puglRealize().