# Package com.codename1.gpu

package com.codename1.gpu

Low level GPU accelerated graphics API for Codename One.

This package exposes a hardware rendering abstraction built around a `GraphicsDevice` and `Renderer` together with the resources they consume: `Mesh`, `VertexBuffer`, `IndexBuffer`, `VertexFormat`, `Texture`, `Material`, `Light` and `RenderState`. It supports drawing 3D `Primitives`, embedding output in a `RenderView` and loading models via the `GltfLoader`. Use `GpuCapabilities` to query what the underlying device supports at runtime.

- Class
  Description
  Camera
  A perspective or orthographic camera.
  GltfLoader
  Loads a `Mesh` from a glTF 2.0 model so applications can render real authored geometry rather than only the built in `Primitives`.
  GltfLoader.GltfImageModel
  A loaded glTF model in device-free form: its geometry plus the decoded base-color image extracted from the model's first material, if any.
  GltfLoader.GltfModel
  A loaded glTF model: its geometry plus the base-color texture extracted from the model's first material, if any.
  GpuCapabilities
  Immutable description of the capabilities and limits of a `GraphicsDevice`.
  GraphicsDevice
  The low level command surface of the 3D API, bound to a single `RenderView` and its GPU context.
  IndexBuffer
  Holds the element indices used to assemble primitives from a `VertexBuffer`.
  Light
  A single directional light plus a global ambient term, consumed by lit materials (`Material.Type.LAMBERT` and `Material.Type.PHONG`).
  Material
  A declarative description of how a surface should be shaded.
  Material.Type
  The built in lighting model used to shade a surface.
  Matrix4
  Portable column-major 4x4 float matrix math used by the 3D API.
  Mesh
  Renderable geometry: a `VertexBuffer`, an optional `IndexBuffer` and the `PrimitiveType` that ties the vertices into shapes.
  Primitives
  Factory helpers that build common `Mesh` primitives.
  PrimitiveType
  The geometric primitive a `Mesh` is assembled from.
  Quaternion
  Portable quaternion math used by the 3D, AR and VR APIs.
  Renderer
  Application supplied callback that drives the contents of a `RenderView`.
  RenderState
  Fixed function pipeline state attached to a `Material`: depth testing, alpha blending and face culling.
  RenderState.BlendMode
  The alpha blending mode applied when a fragment is written.
  RenderState.CullMode
  Which triangle faces are discarded before rasterization.
  RenderView
  A Codename One component that hosts a hardware accelerated 3D rendering surface and drives an application supplied `Renderer`.
  Texture
  A GPU texture.
  Texture.Filter
  The sampling filter applied when the texture is scaled.
  Texture.Wrap
  The texture coordinate wrapping behavior outside the 0..1 range.
  VertexAttribute
  Describes a single attribute (position, normal, texture coordinate, color) within a `VertexFormat`.
  VertexAttribute.Usage
  The semantic meaning of a vertex attribute.
  VertexBuffer
  Holds interleaved vertex data for a `Mesh`.
  VertexFormat
  An ordered, interleaved layout of `VertexAttribute`s describing how the floats of a `VertexBuffer` are grouped into vertices.