public void Dispose() { if (voiceprintBuffer != null) { voiceprintBuffer.Dispose(); voiceprintBuffer = null; } }
public void Dispose() { if (buffer != null) { buffer.Dispose(); buffer = null; } }
private void ResizeToWidgetSize() { if (renderWidth == widgetWidth && renderHeight == widgetHeight) { if (resizeTexture != null) { resizeTexture.Dispose(); resizeTexture = null; } return; } if (resizeTexture == null) { resizeTexture = new TextureHandle(); } resizeTexture.SetTextureSize(renderWidth, renderHeight); Gl.glPushAttrib(Gl.GL_ENABLE_BIT); Gl.glDisable(Gl.GL_DEPTH_TEST); Gl.glEnable(Gl.GL_TEXTURE_2D); Gl.glTexEnvf(Gl.GL_TEXTURE_ENV, Gl.GL_TEXTURE_ENV_MODE, Gl.GL_DECAL); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_WRAP_S, Gl.GL_CLAMP); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_WRAP_T, Gl.GL_CLAMP); Gl.glBindTexture(Gl.GL_TEXTURE_2D, resizeTexture.TextureId); Gl.glCopyTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_RGB, 0, 0, renderWidth, renderHeight, 0); Gl.glViewport(0, 0, widgetWidth, widgetHeight); Gl.glMatrixMode(Gl.GL_PROJECTION); Gl.glLoadIdentity(); Gl.glMatrixMode(Gl.GL_MODELVIEW); Gl.glLoadIdentity(); Gl.glColor4f(1, 1, 1, 1); Gl.glBegin(Gl.GL_QUADS); Gl.glTexCoord2f(0, 0); Gl.glVertex2f(-1, -1); Gl.glTexCoord2f(0, 1); Gl.glVertex2f(-1, 1); Gl.glTexCoord2f(1, 1); Gl.glVertex2f(1, 1); Gl.glTexCoord2f(1, 0); Gl.glVertex2f(1, -1); Gl.glEnd(); Gl.glPopAttrib(); }