Query

class arcade.gl.Query(ctx: Context, samples=True, time=True, primitives=True)[source]

Bases:

A query object to perform low level measurements of OpenGL rendering calls.

The best way to create a program instance is through arcade.gl.Context.query()

Example usage:

query = ctx.query()
with query:
    geometry.render(..)

print('samples_passed:', query.samples_passed)
print('time_elapsed:', query.time_elapsed)
print('primitives_generated:', query.primitives_generated)
Parameters:
  • ctx – The context this query object belongs to

  • samples – Enable counting written samples

  • time – Enable measuring time elapsed

  • primitives – Enable counting primitives

property ctx: Context

The context this query object belongs to

property samples_passed: int

How many samples was written. These are per component (RGBA)

If one RGBA pixel is written, this will be 4.

property time_elapsed: int

The time elapsed in nanoseconds

property primitives_generated: int

How many primitives a vertex or geometry shader processed.

When using a geometry shader this only counts the primitives actually emitted.

delete()[source]

Destroy the underlying OpenGL resource.

Don’t use this unless you know exactly what you are doing.

static delete_glo(ctx, glos) None[source]

Delete this query object.

This is automatically called when the object is garbage collected.