Example #1
0
    public PrimitiveRenderer(
        Camera camera,
        Shader textShader,
        Shader texturedShader,
        Font font,
        int capacity = DefaultTriangleCapacity)
    {
        mesh = new Mesh();
        mesh.MarkDynamic();

        subMeshes = new SubMeshList(InitialSubMeshCapacity + 1);

        this.camera = camera;
        this.font   = font;

        Font.textureRebuilt += OnFontTextureRebuilt;
        font.RequestCharactersInTexture("■");
        OnFontTextureRebuilt(font);

        camera.AddCommandBuffer(CameraEvent.AfterForwardAlpha, commandBuffer);

        textMaterial     = new Material(textShader);
        texturedMaterial = new Material(texturedShader);

        uvs              = new List <Vector2>(capacity);
        vertices         = new List <Vector3>(capacity);
        colors           = new List <Color32>(capacity);
        indices          = new List <int>(capacity);
        temporaryIndices = new List <int>(capacity);

        propertyId            = Shader.PropertyToID("_MainTex");
        materialPropertyBlock = new MaterialPropertyBlock();

        Matrix = Matrix4x4.identity;
    }
Example #2
0
 public SubMeshList(SubMeshList other) : this(OgrePINVOKE.new_SubMeshList__SWIG_1(SubMeshList.getCPtr(other)), true)
 {
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #3
0
 public SubMeshListEnumerator(SubMeshList collection)
 {
     collectionRef = collection;
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
Example #4
0
 public void SetRange(int index, SubMeshList values)
 {
     OgrePINVOKE.SubMeshList_SetRange(swigCPtr, index, SubMeshList.getCPtr(values));
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #5
0
 public void AddRange(SubMeshList values)
 {
     OgrePINVOKE.SubMeshList_AddRange(swigCPtr, SubMeshList.getCPtr(values));
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #6
0
        public SubMeshList getSubMeshes()
        {
            SubMeshList ret = new SubMeshList(OgrePINVOKE.Mesh_getSubMeshes(swigCPtr), false);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #7
0
        public static SubMeshList Repeat(SubMesh value, int count)
        {
            global::System.IntPtr cPtr = OgrePINVOKE.SubMeshList_Repeat(SubMesh.getCPtr(value), count);
            SubMeshList           ret  = (cPtr == global::System.IntPtr.Zero) ? null : new SubMeshList(cPtr, true);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #8
0
        public SubMeshList GetRange(int index, int count)
        {
            global::System.IntPtr cPtr = OgrePINVOKE.SubMeshList_GetRange(swigCPtr, index, count);
            SubMeshList           ret  = (cPtr == global::System.IntPtr.Zero) ? null : new SubMeshList(cPtr, true);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SubMeshList obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }