Browse Source

debug prints (commented out)

pull/1639/head
bsp2 6 years ago
parent
commit
6ada0ba8c8
7 changed files with 47 additions and 10 deletions
  1. +4
    -0
      src/app/RackRail.cpp
  2. +1
    -0
      src/app/RackScene.cpp
  3. +1
    -0
      src/app/RackWidget.cpp
  4. +1
    -0
      src/app/Toolbar.cpp
  5. +1
    -0
      src/ui/ScrollWidget.cpp
  6. +9
    -9
      src/widgets/Widget.cpp
  7. +30
    -1
      src/window.cpp

+ 4
- 0
src/app/RackRail.cpp View File

@@ -6,6 +6,8 @@ namespace rack {
void RackRail::draw(NVGcontext *vg) {
const float railHeight = RACK_GRID_WIDTH;

// printf("xxx RackRail::draw: ENTER\n");

// Background color
nvgBeginPath(vg);
nvgRect(vg, 0.0, 0.0, box.size.x, box.size.y);
@@ -55,6 +57,8 @@ void RackRail::draw(NVGcontext *vg) {
nvgFillColor(vg, nvgRGBf(1.0, 1.0, 1.0));
nvgFill(vg);
}

// printf("xxx RackRail::draw: LEAVE\n");
}




+ 1
- 0
src/app/RackScene.cpp View File

@@ -57,6 +57,7 @@ void RackScene::step() {
}

void RackScene::draw(NVGcontext *vg) {
// printf("xxx RackScene::draw\n");
Scene::draw(vg);
}



+ 1
- 0
src/app/RackWidget.cpp View File

@@ -659,6 +659,7 @@ void RackWidget::step() {
}

void RackWidget::draw(NVGcontext *vg) {
// printf("xxx RackWidget::draw\n");
Widget::draw(vg);
}



+ 1
- 0
src/app/Toolbar.cpp View File

@@ -507,6 +507,7 @@ Toolbar::Toolbar() {
}

void Toolbar::draw(NVGcontext *vg) {
// printf("xxx Toolbar::draw\n");
bndBackground(vg, 0.0, 0.0, box.size.x, box.size.y);
bndBevel(vg, 0.0, 0.0, box.size.x, box.size.y);



+ 1
- 0
src/ui/ScrollWidget.cpp View File

@@ -68,6 +68,7 @@ void ScrollWidget::scrollTo(Rect r) {
}

void ScrollWidget::draw(NVGcontext *vg) {
// printf("xxx ScrollWidget::draw\n");
nvgScissor(vg, 0, 0, box.size.x, box.size.y);
Widget::draw(vg);
nvgResetScissor(vg);


+ 9
- 9
src/widgets/Widget.cpp View File

@@ -109,20 +109,20 @@ void Widget::step() {
}

void Widget::draw(NVGcontext *vg) {
for (Widget *child : children) {
for (Widget *child : children) {
// printf("xxx Widget::draw: 1 child=%p vg=%p\n", child, vg);
if (!child->visible)
continue;
if (!child->visible)
continue;
// printf("xxx Widget::draw: 2 child=%p\n", child);
nvgSave(vg);
// printf("xxx Widget::draw: 3 child=%p\n", child);
nvgTranslate(vg, child->box.pos.x, child->box.pos.y);
nvgSave(vg);
// printf("xxx Widget::draw: 3 child=%p p=(%f; %f)\n", child, child->box.pos.x, child->box.pos.y);
nvgTranslate(vg, child->box.pos.x, child->box.pos.y);
// printf("xxx Widget::draw: 4 child=%p\n", child);
child->draw(vg);
child->draw(vg);
// printf("xxx Widget::draw: 5 child=%p\n", child);
nvgRestore(vg);
nvgRestore(vg);
// printf("xxx Widget::draw: 6 child=%p\n", child);
}
}
}

#define RECURSE_EVENT_POSITION(_method) { \


+ 30
- 1
src/window.cpp View File

@@ -348,18 +348,28 @@ void renderGui() {
// printf("xxx renderGui: ENTER\n");
lglw_window_size_get(global_ui->window.lglw, &width, &height);

// printf("xxx renderGui: 1 lglw=%p size=(%d; %d)\n", global_ui->window.lglw, width, height);

// Update and render
nvgBeginFrame(global_ui->window.gVg, width, height, global_ui->window.gPixelRatio);

// printf("xxx renderGui: 2\n");

nvgReset(global_ui->window.gVg);
// printf("xxx renderGui: 3\n");
nvgScale(global_ui->window.gVg, global_ui->window.gPixelRatio, global_ui->window.gPixelRatio);
// printf("xxx renderGui: gScene->draw() BEGIN\n");
// printf("xxx renderGui: 4\n");
global_ui->ui.gScene->draw(global_ui->window.gVg);
// printf("xxx renderGui: gScene->draw() END\n");
// printf("xxx renderGui: 5\n");

glViewport(0, 0, width, height);
// printf("xxx renderGui: 6\n");
glClearColor(0.0, 0.0, 0.0, 1.0);
// printf("xxx renderGui: 7\n");
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
// printf("xxx renderGui: 8\n");
nvgEndFrame(global_ui->window.gVg);
// printf("xxx renderGui: LEAVE\n");
}
@@ -386,7 +396,7 @@ void windowInit() {

lglw_glcontext_push(global_ui->window.lglw);
printf("xxx vstrack_plugin:windowInit: 5\n");
lglw_swap_interval_set(global_ui->window.lglw, 1); // can be overridden via settings.json:"vsync" property
global_ui->pending_swap_interval = 1;
printf("xxx vstrack_plugin:windowInit: 6\n");

lglw_mouse_callback_set (global_ui->window.lglw, &lglw_mouse_cbk);
@@ -479,9 +489,18 @@ void windowDestroy() {
void vst2_editor_redraw(void) {
// (note) the GL context is set by the caller

// printf("xxx vst2_editor_redraw: ENTER\n");

if(-1 != global_ui->pending_swap_interval)
{
lglw_swap_interval_set(global_ui->window.lglw, global_ui->pending_swap_interval); // can be overridden via settings.json:"vsync" property
global_ui->pending_swap_interval = -1;
}

global_ui->window.gGuiFrame++;

// Find/validate hover param
// printf("xxx vst2_editor_redraw: 2 global_ui->param_info.last_param_widget=%p\n", global_ui->param_info.last_param_widget);
if(NULL != global_ui->param_info.last_param_widget)
{
int uniqueParamId;
@@ -541,6 +560,7 @@ void vst2_editor_redraw(void) {
}
}
// printf("xxx vst2_editor_redraw: 3\n");

#if 0
// Set window title
@@ -565,15 +585,24 @@ void vst2_editor_redraw(void) {
global_ui->window.gWindowRatio = 1.0f;
global_ui->ui.gScene->box.size = Vec(width, height);

// printf("xxx vst2_editor_redraw: 4\n");

// Step scene
global_ui->ui.gScene->step();

// printf("xxx vst2_editor_redraw: 5\n");

// Render
renderGui();

// printf("xxx vst2_editor_redraw: 6\n");

// Present
glFlush();
// printf("xxx vst2_editor_redraw: 7\n");
lglw_swap_buffers(global_ui->window.lglw);

// printf("xxx vst2_editor_redraw: LEAVE\n");
}

void windowCursorLock() {


Loading…
Cancel
Save