Пример #1
0
        public BntxEditor()
        {
            InitializeComponent();
            FilePath = "";
            Text     = "New Binary Texture";

            fw                     = new FileSystemWatcher();
            fw.Path                = Path.GetTempPath();
            fw.NotifyFilter        = NotifyFilters.Size | NotifyFilters.LastAccess | NotifyFilters.LastWrite;
            fw.EnableRaisingEvents = false;
            fw.Changed            += new FileSystemEventHandler(OnChanged);
            fw.Filter              = "";

            MenuItem export = new MenuItem("Export");

            export.Click += exportTextureToolStripMenuItem_Click;
            textureMenu.MenuItems.Add(export);

            MenuItem replace = new MenuItem("Replace");

            replace.Click += replaceTextureToolStripMenuItem_Click;
            textureMenu.MenuItems.Add(replace);

            OpenTkSharedResources.InitializeSharedResources();
            if (OpenTkSharedResources.SetupStatus == OpenTkSharedResources.SharedResourceStatus.Initialized)
            {
                screenTriangle = ScreenDrawing.CreateScreenTriangle();
            }
        }
Пример #2
0
 private void AddTextureThumbnails(ImageList imageList)
 {
     // Reuse the same context to avoid CPU bottlenecks.
     using (OpenTK.GameWindow gameWindow = OpenTkSharedResources.CreateGameWindowContext(64, 64))
     {
         Nud.Material mat = currentMaterialList[currentMatIndex];
         RenderMaterialTexturesAddToImageList(imageList, mat);
     }
 }
Пример #3
0
 private void glControl1_Load(object sender, System.EventArgs e)
 {
     OpenTkSharedResources.InitializeSharedResources();
     if (OpenTkSharedResources.SetupStatus == OpenTkSharedResources.SharedResourceStatus.Initialized)
     {
         nut.RefreshGlTexturesByHashId();
         pngExportFramebuffer = new Framebuffer(FramebufferTarget.Framebuffer, glControl1.Width, glControl1.Height);
         screenTriangle       = ScreenDrawing.CreateScreenTriangle();
     }
 }
Пример #4
0
 private void SetUpRendering()
 {
     // Make sure the shaders and textures are ready for rendering.
     OpenTkSharedResources.InitializeSharedResources();
     if (OpenTkSharedResources.SetupStatus == OpenTkSharedResources.SharedResourceStatus.Initialized)
     {
         currentNut.RefreshGlTexturesByHashId();
         pngExportFramebuffer = new Framebuffer(FramebufferTarget.Framebuffer, glControl1.Width, glControl1.Height);
         screenTriangle       = ScreenDrawing.CreateScreenTriangle();
     }
 }
Пример #5
0
 private void glControl1_Load(object sender, EventArgs e)
 {
     OpenTkSharedResources.InitializeSharedResources();
     if (OpenTkSharedResources.SetupStatus == OpenTkSharedResources.SharedResourceStatus.Initialized)
     {
         if (sourceNud != null)
         {
             glControl1.MakeCurrent();
             forgeMesh = sourceNud.CreateRenderMesh(polygonToRender);
             // Ignore the material values.
             forgeMesh.ResetRenderSettings();
         }
     }
 }
Пример #6
0
        public NudMaterialEditor(Nud.Polygon p) : this()
        {
            currentPolygon      = p;
            currentMaterialList = p.materials;
            Init();
            FillForm();
            ResizeGlControlsToMaxSquareSize(glControlTableLayout);
            matsComboBox.SelectedIndex      = 0;
            texturesListView.LargeImageList = textureThumbnails;

            RefreshTexturesImageList();

            // The dummy textures will be used later.
            OpenTkSharedResources.InitializeSharedResources();
            if (OpenTkSharedResources.SetupStatus == OpenTkSharedResources.SharedResourceStatus.Initialized)
            {
                // Only happens once.
                UpdateMaterialThumbnails();
            }
        }
Пример #7
0
 private void charDifColorGLControl_Load(object sender, EventArgs e)
 {
     OpenTkSharedResources.InitializeSharedResources();
 }