Beispiel #1
0
bool QtAGain::open(void* ptr)
{
  AEffEditor::open (ptr);
  widget = new QVstPanel(effect, static_cast<HWND>(ptr));
  widget->move( 0, 0 );
  widget->adjustSize();
  rectangle.top = 0;
  rectangle.left = 0;
  rectangle.bottom = widget->height();
  rectangle.right = widget->width();
  widget->setMinimumSize(widget->size());
  widget->show();
  clientResize(static_cast<HWND>(ptr), widget->width(), widget->height());

  connect(this, SIGNAL(update(float)), widget, SLOT(update(float)));
  return true;
}
Beispiel #2
0
bool
RenderWindow::create(const Application* application,
                     const std::string&  name,
                     bool windowed,
                     int width,
                     int height)
{
    Window::create (name, windowed, width, height);
    {

        _solidBrush = (HBRUSH)(CreateSolidBrush(RGB(0,0,0)));
        static const WCHAR* const windowClassStr = (L"IBLBaker Render Target Class");
        WNDCLASSEX windowClass = {
            sizeof(WNDCLASSEX),
            CS_OWNDC, 
            windowProc,
            0, 
            0, 
            application->instance(),
            0, 
            LoadCursor(0, IDC_ARROW), 
            _solidBrush, 
            0, 
            windowClassStr,
            0 
        };

        //set the icon instance for this application that we are creating for    
        windowClass.hIcon  = 
                LoadIcon (application->instance(), MAKEINTRESOURCE(IDI_DEFAULT));

        if (RegisterClassEx (&windowClass))
        {
            // adjust the window size so that the client area matches the arguments
            RECT size = { 0, 0, Window::width(), Window::height()};

            const std::string& windowNameStr = windowName();
            std::wstring windowNameW (windowNameStr.begin(), windowNameStr.end());
            HINSTANCE instance = application->instance();

            AdjustWindowRect(&size,
                WS_OVERLAPPEDWINDOW, FALSE);

            DWORD fullWidth = (size.right - size.left);
            DWORD fullHeight = (size.bottom - size.top);
            //create window
            WindowHandle handle = 
                    CreateWindow ((WCHAR*)windowClassStr, 
                                  (WCHAR*)windowNameW.c_str(),
                                  WS_OVERLAPPEDWINDOW,
                                  CW_USEDEFAULT, CW_USEDEFAULT,
                                  fullWidth, fullHeight, 0,
                                  0,
                                  instance, this);
            if (handle)
            {
                setWindowHandle (handle);


                ShowWindow (windowHandle(), SW_SHOWNORMAL);
                updateBounds();

                clientResize(handle, width, height);
                UpdateWindow (windowHandle());
                return true;
            }
            else
            {
                THROW ("Failed to create window handle");
            }
        }
    }

    return false;
}