Ejemplo n.º 1
0
 void Reshape()
 {
     width  = screen.Width;
     height = screen.Height;
     fgroup.SetSize(screen.Width, screen.Height);
     double h = (double)height / (double)width;
 }
Ejemplo n.º 2
0
 void Init()
 {
     //Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
     fgroup = new FlurryGroup(settings.specs[preset]);
     fgroup.SetSize(screen.Width, screen.Height);
     fgroup.PrepareToAnimate();
     framecount     = 0;
     txtSprite.Text = settings.specs[preset].name;
 }
Ejemplo n.º 3
0
        void AttachGLToWindow(/*FlurryAnimateChildInfo *child*/)
        {
            Gdi.PIXELFORMATDESCRIPTOR pfd = new Gdi.PIXELFORMATDESCRIPTOR();            //HACK
            pfd.nSize      = (short)System.Runtime.InteropServices.Marshal.SizeOf(pfd);
            pfd.nVersion   = 1;
            pfd.dwFlags    = Gdi.PFD_DRAW_TO_WINDOW | Gdi.PFD_SUPPORT_OPENGL;
            pfd.iPixelType = Gdi.PFD_TYPE_RGBA;
            pfd.iLayerType = Gdi.PFD_MAIN_PLANE;
            pfd.cDepthBits = 16;
            pfd.cColorBits = 24;
                        #if !USEFADEHACK
            if (Types.iSettingBufferMode != Types.BUFFER.BUFFER_MODE_SINGLE)
            {
                pfd.dwFlags |= Gdi.PFD_DOUBLEBUFFER;
            }
                        #endif
            hdc = User.GetDC(this.Handle);
            //Win32.GDI.SetBkColor(hdc, 0);
            int iPixelFormat = Gdi.ChoosePixelFormat(hdc, ref pfd);

            Gdi.SetPixelFormat(hdc, iPixelFormat, ref pfd);

            // then use this to create a rendering context
            hglrc = Wgl.wglCreateContext(hdc);
            Wgl.wglMakeCurrent(hdc, hglrc);

            // tell Flurry to use the whole window as viewport
            //GetClientRect(child->hWnd, &rc);
            flgroup.SetSize(this.Width, this.Height);

            // some nice debug output
            //_RPT4(_CRT_WARN, "  child 0x%08x: hWnd 0x%08x, hdc 0x%08x, hglrc 0x%08x\n",
            //    child, child->hWnd, child->hdc, child->hglrc);
            //_RPT1(_CRT_WARN, "  GL vendor:     %s\n", glGetString(GL_VENDOR));
            //_RPT1(_CRT_WARN, "  GL renderer:   %s\n", glGetString(GL_RENDERER));
            //_RPT1(_CRT_WARN, "  GL version:    %s\n", glGetString(GL_VERSION));
            //_RPT1(_CRT_WARN, "  GL extensions: %s\n", glGetString(GL_EXTENSIONS));
            //_RPT0(_CRT_WARN, "\n");
        }
Ejemplo n.º 4
0
 void Init()
 {
     //Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
     fgroup = new FlurryGroup(settings.specs[preset]);
     fgroup.SetSize(screen.Width, screen.Height);
     fgroup.PrepareToAnimate();
     framecount = 0;
     txtSprite.Text = settings.specs[preset].name;
 }