本文整理汇总了C#中NewTOAPIA.GL.GraphicsInterface类的典型用法代码示例。如果您正苦于以下问题:C# GraphicsInterface类的具体用法?C# GraphicsInterface怎么用?C# GraphicsInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GraphicsInterface类属于NewTOAPIA.GL命名空间,在下文中一共展示了GraphicsInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GLSketchViewer
public GLSketchViewer(GraphicsInterface gi, int width, int height)
{
fDynamicTexture = new SnapNGLView.DynamicTexture(gi, width, height, 3);
// Create the backing buffer to retain the image
backingBuffer = new PixelBuffer24(width, height);
//backingBuffer.DeviceContext.ClearToWhite();
// 1. Show a dialog box to allow the user to type in the
// group IP address and port number.
HostForm groupForm = new HostForm();
groupForm.ShowDialog();
// 2. Get the address and port from the form, and use
// them to setup the MultiSession object
string groupIP = groupForm.groupAddressField.Text;
int groupPort = int.Parse(groupForm.groupPortField.Text);
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(groupIP), groupPort);
// Create the session
fSession = new MultiSession(Guid.NewGuid().ToString(), ipep);
// Add the channel for graphics commands
fSketchChannel = fSession.CreateChannel(PayloadType.Whiteboard);
// 3. Setup the chunk decoder so we can receive new images
// when they come in
fChunkDecoder = new GraphPortChunkDecoder(backingBuffer, fSketchChannel);
fChunkDecoder.PixBltPixelBuffer24Handler += this.PixBltPixelBuffer24;
fChunkDecoder.PixBltLumbHandler += this.PixBltLum24;
//fSketchChannel.FrameReceivedEvent += FrameReceived;
}
示例2: SetupTexture2D
protected virtual void SetupTexture2D(GraphicsInterface gi, int width, int height, TextureInternalFormat internalFormat, TexturePixelFormat pixelFormat, PixelComponentType pixelType, IntPtr pixelData, bool createMipMaps)
{
fWidth = width;
fHeight = height;
fInternalFormat = internalFormat;
fPixelFormat = pixelFormat;
fPixelType = pixelType;
// Setup the alignment
fGI.PixelStore(PixelStore.UnpackAlignment, 1);
// Allocate storage for the texture
// We do this once at the beginning to allocate space for the texture object
fGI.TexImage2D(0, internalFormat, fWidth, fHeight, 0, pixelFormat, pixelType, pixelData);
// Setup default filters and wrapping
SetupFiltering();
SetupWrapping();
if (createMipMaps)
{
// Make call to generate MipMap
//fGI.GenerateMipmap();
// Alter the min filter to use the mipmap
fGI.TexParameter(TextureParameterTarget.Texture2d, TextureParameterName.TextureMinFilter, TextureMinFilter.LinearMipmapLinear);
}
}
示例3: BeginRender
protected override void BeginRender(GraphicsInterface gi)
{
gi.Glu.QuadricNormals(Handle, (int)fNormalType);
gi.Glu.QuadricDrawStyle(Handle, (int)fDrawingStyle);
gi.Glu.QuadricOrientation(Handle, (int)fOrientation);
gi.Glu.QuadricTexture(Handle, fUsesTexture);
}
示例4: DrawQuad
void DrawQuad(GraphicsInterface GI, float left, float top, float right, float bottom)
{
GI.PushMatrix();
GI.Rotate(Rotation);
GI.Drawing.Quads.Begin();
// Left bottom
GI.TexCoord(0.0f, 0.0f);
GI.Vertex(left, bottom, 0.0f);
// Left top
GI.TexCoord(0.0f, 1.0f);
GI.Vertex(left, top, 0.0f);
// Right top
GI.TexCoord(1.0f, 1.0f);
GI.Vertex(right, top, 0.0f);
// Right bottom
GI.TexCoord(1.0f, 0.0f);
GI.Vertex(right, bottom, 0.0f);
GI.Drawing.Quads.End();
GI.PopMatrix();
}
示例5: ConferenceRoom
public ConferenceRoom(GraphicsInterface gi, Vector3D roomSize)
: base(gi, roomSize, new Vector3D(0, roomSize.Y / 2.0f, 0), new Resolution(10, 10))
{
fWallTexture = TextureHelper.CreateTextureFromFile(gi, "Textures\\Wall.tiff", false);
fCeilingTexture = TextureHelper.CreateTextureFromFile(gi, "Textures\\Ceiling.tiff", false);
fFloorTexture = TextureHelper.CreateTextureFromFile(gi, "Textures\\Carpet_berber_dirt.jpg", false);
fChildren = new List<IRenderable>();
SetWallTexture(AABBFace.Ceiling, fCeilingTexture);
SetWallTexture(AABBFace.Floor, fFloorTexture);
SetWallTexture(AABBFace.Front, fWallTexture);
SetWallTexture(AABBFace.Back, fWallTexture);
SetWallTexture(AABBFace.Left, fWallTexture);
SetWallTexture(AABBFace.Right, fWallTexture);
Vector3D wbSize = new Vector3D(4.0f-(0.305f*2.0f), 3.0f, 0.01f);
Point3D wbTrans = new Point3D(0, (wbSize.Y/2)+(roomSize.Y-wbSize.Y)/2, -roomSize.Z / 2.0f+.02f);
AABB wbBB = new AABB(wbSize, wbTrans);
whiteboard = new Whiteboard(gi, wbBB);
//whiteboard.ImageSource = localCamProjector;
fTable = new PedestalTable(gi);
fChildren.Add(whiteboard);
fChildren.Add(fTable);
}
示例6: GLUSphere
public GLUSphere(GraphicsInterface gi, double radius, int slices, int stacks)
:base(gi, QuadricDrawStyle.Fill, QuadricNormalType.Smooth, QuadricOrientation.Outside)
{
fRadius = radius;
fSlices = slices;
fStacks = stacks;
}
示例7: CreateContext
public bool CreateContext(IntPtr windowHandle, int colorBits, int depthBits, int stencilBits)
{
fGLContext = new GLContext(windowHandle, colorBits, depthBits, PFDFlags.DoubleBuffer);
fGI = new GraphicsInterface(fGLContext);
return (null != fGLContext);
}
示例8: BeginRender
protected override void BeginRender(GraphicsInterface gi)
{
if (fUseColors && (null != Colors))
{
gi.ClientFeatures.ColorArray.Enable();
gi.ColorPointer(Colors);
}
//if (fUseEdges && (null != Edges))
// gi.EnableClientState(ClientArrayType.EdgeFlagArray);
if (fUseIndices && (null != Indices))
{
gi.ClientFeatures.IndexArray.Enable();
gi.IndexPointer(IndexPointerType.Int, 0, Indices);
}
if (fUseNormals && (null != Normals))
{
gi.ClientFeatures.NormalArray.Enable();
gi.NormalPointer(Normals);
}
if (fUseTexture && (null != TexCoords))
{
gi.ClientFeatures.TextureCoordArray.Enable();
gi.TexCoordPointer(TexCoords);
}
if (fUseVertices && (null != Vertices))
{
gi.ClientFeatures.VertexArray.Enable();
gi.VertexPointer(Vertices);
}
}
示例9: RenderContent
protected override void RenderContent(GraphicsInterface gi)
{
int p1, p2, p3;
for (int i = 0; i < triangles.Length; i++)
{
p1 = triangles[i].p1;
p2 = triangles[i].p2;
p3 = triangles[i].p3;
gi.Color(1, 1, 1, 0.95f);
gi.Drawing.Triangles.Begin();
gi.Normal(normals[p1]);
gi.TexCoord(uvMap[p1, 0], uvMap[p1, 1]);
gi.Vertex(positions[p1]);
gi.Normal(normals[p2]);
gi.TexCoord(uvMap[p2, 0], uvMap[p2, 1]);
gi.Vertex(positions[p2]);
gi.Normal(normals[p3]);
gi.TexCoord(uvMap[p3, 0], uvMap[p3, 1]);
gi.Vertex(positions[p3]);
gi.Drawing.Triangles.End();
}
}
示例10: DCTProcessor
public DCTProcessor(GraphicsInterface gi, int width, int height)
{
fGI = gi;
fWidth = width;
fHeight = height;
// Create the cosine buffer
// Calculate the cosines
// assign the values to the texture object
fCosineBuffer = new GLTextureRectangle(gi, 8, 8, TextureInternalFormat.Luminance, TexturePixelFormat.Luminance, PixelType.Float);
fRenderTarget = new GLRenderTarget(gi, width, height);
fDCTOutputTexture = new GLTextureRectangle(gi, width, height, TextureInternalFormat.Rgba, TexturePixelFormat.Rgba, PixelType.Float);
// We attach the texture 4 times so we can output to the same texture four times
// in one shader pass using gl_FragData[0,1,2,3]
fRenderTarget.AttachColorBuffer(fDCTOutputTexture, ColorBufferAttachPoint.Position0);
fRenderTarget.AttachColorBuffer(fDCTOutputTexture, ColorBufferAttachPoint.Position1);
fRenderTarget.AttachColorBuffer(fDCTOutputTexture, ColorBufferAttachPoint.Position2);
fRenderTarget.AttachColorBuffer(fDCTOutputTexture, ColorBufferAttachPoint.Position3);
fRenderTarget.Unbind();
// Precalculate the basis functions (cosine tables)
}
示例11: BrickShader
public BrickShader(GraphicsInterface gi)
: base(gi)
{
//Console.WriteLine("BrickShader Link Log: \n{0}", InfoLog);
GLSLVertexShader vShader = new GLSLVertexShader(gi, Brick_VertexSource);
AttachShader(vShader);
GLSLFragmentShader fShader = new GLSLFragmentShader(gi, Brick_FragmentSource);
AttachShader(fShader);
Link();
// Do an initial selection so that all the variables can be located
Bind();
BrickColor_Pos = GetUniformLocation("BrickColor");
MortarColor_Pos = GetUniformLocation("MortarColor");
BrickSize_Pos = GetUniformLocation("BrickSize");
BrickPct_Pos = GetUniformLocation("BrickPct");
// From the Vertex Shader
LightPosition_Pos = GetUniformLocation("LightPosition");
// Set some initial values
BrickColor = new ColorRGBA(1.0f, 0.3f, 0.2f);
MortarColor = new ColorRGBA(0.85f, 0.86f, 0.84f);
BrickSize = new float2(0.30f, 0.15f);
BrickPct = new float2(0.90f, 0.85f);
LightPosition = new Vector3f(0.0f, 0.0f, 4.0f);
// Unselect so we start in an unselected state
Unbind();
}
示例12: GLRenderBuffer
public GLRenderBuffer(GraphicsInterface gi, int width, int height, int format)
: this(gi)
{
Bind();
GI.RenderbufferStorage(gl.GL_RENDERBUFFER_EXT, format, width, height);
Unbind();
}
示例13: Mesh3D
//public Mesh3D(BeginMode mode)
// :this(null, mode)
//{
//}
public Mesh3D(GraphicsInterface gi, BeginMode mode)
{
GI = gi;
fDrawingPrimitive = mode;
fUseVertices = true;
fUseIndices = true;
}
示例14: Render
/// <summary>
/// This override is called by whomever is controlling the rendering process.
/// We call the base Render method as it will automatically use the
/// vertices, indices, and texture coordinates to draw the quads.
/// </summary>
/// <param name="GI"></param>
public override void Render(GraphicsInterface GI)
{
if (fUseTexture)
GI.Features.Texturing2D.Enable();
base.Render(GI);
}
示例15: RenderContent
protected override void RenderContent(GraphicsInterface GI)
{
// Draw Section 0
GI.PushMatrix();
GI.Rotate(0, 0, 1, 0);
GI.Translate(0, 4, fSpeakerSection0.Radius * fSpeakerSeparation);
fSpeakerSection0.Render(GI);
GI.PopMatrix();
// Draw Section 90
GI.PushMatrix();
GI.Rotate(90, 0, 1, 0);
GI.Translate(0, 4, fSpeakerSection90.Radius * fSpeakerSeparation);
fSpeakerSection90.Render(GI);
GI.PopMatrix();
// Draw Section 180
GI.PushMatrix();
GI.Rotate(180, 0, 1, 0);
GI.Translate(0, 4, fSpeakerSection180.Radius * fSpeakerSeparation);
fSpeakerSection180.Render(GI);
GI.PopMatrix();
// Draw Section 270
GI.PushMatrix();
GI.Rotate(270, 0, 1, 0);
GI.Translate(0, 4, fSpeakerSection270.Radius * fSpeakerSeparation);
fSpeakerSection270.Render(GI);
GI.PopMatrix();
}