コード例 #1
0
 public void Begin()
 {
     GL.Disable(EnableCap.DepthTest);
     GL.Enable(EnableCap.Blend);
     GL.BlendFunc(BlendingFactorSrc.One, BlendingFactorDest.One);
     GL.EnableClientState(ArrayCap.VertexArray);
     GL.EnableClientState(ArrayCap.ColorArray);
     GL.EnableClientState(ArrayCap.TextureCoordArray);
     GL.BindBuffer(BufferTarget.ArrayBuffer, fontVertexBuffer);
     GL.VertexPointer(3, VertexPointerType.Float, 24, IntPtr.Zero);
     GL.ColorPointer(4, ColorPointerType.UnsignedByte, 24, (IntPtr)12);
     GL.TexCoordPointer(2, TexCoordPointerType.Float, 24, (IntPtr)16);
     Render.SetWorld(ref world);
     Render.SetView(ref view);
     Render.SetProjection(ref projection);
     Render.EnableTexture = true;
     Render.Texture       = textureHandle;
 }
コード例 #2
0
ファイル: MenuDraw1.cs プロジェクト: 0000duck/KAOS-Engine
        void Draw(DrawMethodArgs args)
        {
            PhysicsScene  scene      = demo.Engine.Factory.PhysicsSceneManager.Get(args.OwnerSceneIndex);
            PhysicsObject objectBase = scene.Factory.PhysicsObjectManager.Get(args.OwnerIndex);

            PhysicsObject physicsObjectWithCamera = scene.GetPhysicsObjectWithCamera(0);

            if (physicsObjectWithCamera == null)
            {
                return;
            }

            PhysicsCamera activeCamera = physicsObjectWithCamera.Camera;

            if (activeCamera == null)
            {
                return;
            }

            float time = args.Time;

            if ((infoScreen == null) || (infoDescription == null))
            {
                return;
            }
            if (!infoDescription.EnableDrawing)
            {
                return;
            }

            string sceneScreenName = infoScreen.Material.UserDataStr;

            if (sceneScreenName == null)
            {
                return;
            }
            if (!demo.Descriptions.ContainsKey(sceneScreenName))
            {
                return;
            }

            List <string> Descriptions = demo.Descriptions[sceneScreenName];

            string info = null;

            infoDescription.MainWorldTransform.GetPosition(ref position);
            activeCamera.View.GetViewMatrix(ref view);
            activeCamera.Projection.GetProjectionMatrix(ref projection);

            RenderPCT render = demo.DemoFont3D.Render;

            render.SetWorld(ref world);
            render.SetView(ref view);
            render.SetProjection(ref projection);

            GL.CullFace(CullFaceMode.Back);

            demo.DemoFont3D.Begin();

            for (int i = 0; i < Descriptions.Count; i++)
            {
                info = Descriptions[i];

                if (info != null)
                {
                    demo.DemoFont3D.Draw(position.X - 25.0f, position.Y + 12.0f - 1.4f * i, position.Z - 0.5f, 0.08125f, 0.12125f, info, whiteColor);
                }
            }

            demo.DemoFont3D.End();
        }