Package gov.nasa.worldwind.render
Class ShaderProgram
- java.lang.Object
-
- gov.nasa.worldwind.render.ShaderProgram
-
- All Implemented Interfaces:
RenderResource
- Direct Known Subclasses:
AtmosphereProgram
,BasicShaderProgram
,SightlineProgram
,SurfaceTextureProgram
public class ShaderProgram extends java.lang.Object implements RenderResource
Represents an OpenGL shading language (GLSL) shader program and provides methods for identifying and accessing shader variables. Shader programs are configured by callingsetProgramSources
to specify the the GLSL vertex shader and fragment shader source code, then made current by callinguseProgram
.
-
-
Constructor Summary
Constructors Constructor Description ShaderProgram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getAttribBindings()
int
getProgramLength()
java.lang.String[]
getProgramSources()
void
release(DrawContext dc)
Frees any resources associated with this instance.void
setAttribBindings(java.lang.String... attribBindings)
void
setProgramSources(java.lang.String... programSources)
boolean
useProgram(DrawContext dc)
-
-
-
Method Detail
-
getProgramSources
public java.lang.String[] getProgramSources()
-
setProgramSources
public void setProgramSources(java.lang.String... programSources)
-
getAttribBindings
public java.lang.String[] getAttribBindings()
-
setAttribBindings
public void setAttribBindings(java.lang.String... attribBindings)
-
getProgramLength
public int getProgramLength()
-
release
public void release(DrawContext dc)
Description copied from interface:RenderResource
Frees any resources associated with this instance. After this method returns the rendering resource is invalid, and any associated GL object is deleted.- Specified by:
release
in interfaceRenderResource
- Parameters:
dc
- the current draw context
-
useProgram
public boolean useProgram(DrawContext dc)
-
-