Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "stdafx.h"

#include "Headers/ImWindowManagerDivide.h"
#include "Headers/ImWindowDivide.h"

#include "Editor/Headers/Editor.h"
#include "Core/Headers/PlatformContext.h"

namespace Divide {

ImwWindowManagerDivide::ImwWindowManagerDivide(Editor& parent)
    : _parent(parent),
      _windowCount(0u)
{
}

ImwWindowManagerDivide::~ImwWindowManagerDivide()
{
    Destroy();
}

ImWindow::ImwPlatformWindow* ImwWindowManagerDivide::CreatePlatformWindow(ImWindow::EPlatformWindowType eType, ImWindow::ImwPlatformWindow* pParent)
{
    IM_ASSERT(m_pCurrentPlatformWindow == nullptr);

    ImwWindowDivide* pWindow = MemoryManager_NEW ImwWindowDivide(*this, _parent.context(), eType, CanCreateMultipleWindow());
    if (pWindow->Init(pParent)) {
        return (ImWindow::ImwPlatformWindow*)pWindow;
    } else {
        MemoryManager::SAFE_DELETE(pWindow);
        return nullptr;
    }
}

ImVec2 ImwWindowManagerDivide::GetCursorPos()
{
    return ImVec2(vec2<F32>(_parent.context().app().windowManager().getCursorPosition()));
}

bool ImwWindowManagerDivide::IsLeftClickDown()
{
    return _parent.context().input().getMouseButtonState(0, Input::MouseButton::MB_Left) == Input::InputState::PRESSED;
}


void ImwWindowManagerDivide::renderDrawList(ImDrawData* pDrawData, I64 windowGUID) {
    Attorney::EditorWindowManager::renderDrawList(_parent, pDrawData, windowGUID);
}

void ImwWindowManagerDivide::onCreateWindow(ImwWindowDivide* window) {
    ACKNOWLEDGE_UNUSED(window);

    ++_windowCount;
}

void ImwWindowManagerDivide::onDestroyWindow(ImwWindowDivide* window) {
    if (!window->isMainWindow() && window->nativeWindow()) {
        DisplayWindow* windowPtr = window->nativeWindow();
        _parent.context().app().windowManager().destroyWindow(windowPtr);
    }
    --_windowCount;
}

}; //namespace Divide

Commits for Divide-Framework/trunk/Source Code/Editor/Widgets/ImWindowManagerDivide.cpp

Diff revisions: vs.
Revision Author Commited Message
970 Diff Diff IonutCava picture IonutCava Mon 13 Nov, 2017 17:16:44 +0000

[Ionut]
- ImWindow <-> DisplayWindow fixes

969 Diff Diff IonutCava picture IonutCava Mon 13 Nov, 2017 00:15:57 +0000

[Ionut]
- Further improve DisplayWindow <-> Input relationship
- Add Flip-Y 2D camera (D3D style projection)
- Fix IMGUI rendering
- Add IMGUI sample and IMWINDOW sample rendering at the same time
- Improve IMWINDOW multi-window support
— Bug: nothing rendering in child platform windows
- Add draw command to move render context from one window to another

965 Diff Diff IonutCava picture IonutCava Sun 05 Nov, 2017 21:54:57 +0000

[Ionut]
- ImWindow updates

963 Diff Diff IonutCava picture IonutCava Sun 05 Nov, 2017 18:31:51 +0000

[Ionut]
- More multi-window fixes
- Profile guided performance improvements

962 Diff Diff IonutCava picture IonutCava Fri 03 Nov, 2017 17:17:55 +0000

[Ionut]
- Fix creation/destruction of multiple DisplayWindows
- Add an InputInterface per DisplayWindow
- More work on the ImWindow based Editor

960 Diff Diff IonutCava picture IonutCava Thu 02 Nov, 2017 17:39:53 +0000

[Ionut]
- Started porting ImWindow to our command buffer based rendering system.
- Also moved mouse positioning system to the window manager since mouse position is always relative to the active window

951 IonutCava picture IonutCava Mon 23 Oct, 2017 23:25:49 +0000

[Ionut]
- Added a new project to the solution: Divide-Editor
— This project will be a Unity-style tool for the framework built using IMGUI and ImWindow
— Examples:

- Modified DisplayWindow class heavily to support new requirements