void VolumetricHybridApproach::update(const string childName, const string fontName) { bool nameChange = _childName == ofToUpper(childName); _childName = ofToUpper(childName); font.load(fontName, 148, true, true, true, 0.3, 300); renderName(); if (shaderChanged || nameChange) { // _volumetricShader.setUniform1i("iterations", _iterations.get()); // _volumetricShader.setUniform1i("iterationsMultiplier", _iterationMultiplier.get()); // _volumetricShader.setUniform1i("volsteps", _volSteps.get()); // _volumetricShader.setUniform1i("volstepsMultiplier", _volStepsMultiplier.get()); // _volumetricShader.setUniform1f("formuparam", _forumparam.get()); // _volumetricShader.setUniform1f("forumparamMultiplier", _forumparamMultiplier.get()); // _volumetricShader.setUniform1f("stepsize", _stepsize.get()); // _volumetricShader.setUniform1f("stepsizeMultiplier", _stepsizeMultiplier.get()); // _volumetricShader.setUniform1f("zoom", _zoom.get()); // _volumetricShader.setUniform1f("brightness", _brightness.get()); // _volumetricShader.setUniform1f("darkmatter", _darkmatter.get()); // _volumetricShader.setUniform1f("distfading", _distfading.get()); // _volumetricShader.setUniform1f("distfadingMultiplier", _distfadingMultiplier.get()); // _volumetricShader.setUniform1f("saturation", _saturation.get()); // _volumetricShader.setUniform1f("tile", _tile.get()); // _volumetricShader.setUniform1f("time", (float)_time.get()); // _volumetricShader.setUniformTexture("tex0", _textRendered.getTexture(), 0); shaderChanged = false; ofLog() << " shader changed "; } }
void RenderView::paint(PaintInfo& i, int _tx, int _ty) { #ifdef DEBUG_LAYOUT kdDebug( 6040 ) << renderName() << "(RenderView) " << this << " ::paintObject() w/h = (" << width() << "/" << height() << ")" << endl; #endif // Cache the print rect because the dirty rect could get changed during painting. if (m_printingMode) setPrintRect(i.r); // 1. paint background, borders etc if (i.phase == PaintPhaseBlockBackground) { paintBoxDecorations(i, _tx, _ty); return; } // 2. paint contents for (RenderObject *child = firstChild(); child; child = child->nextSibling()) if (!child->layer() && !child->isFloating()) child->paint(i, _tx, _ty); if (m_frameView) { _tx += m_frameView->contentsX(); _ty += m_frameView->contentsY(); } // 3. paint floats. if (i.phase == PaintPhaseFloat) paintFloats(i, _tx, _ty); #ifdef BOX_DEBUG outlineBox(i.p, _tx, _ty); #endif }
static int renderGroupHeader(Group* group, int x, int y, int groupSize, int windowSizeX) { // If the group size is larger than the actual screen we adjust it a bit to make the text more visible if (x + groupSize > windowSizeX) groupSize = windowSizeX - x; drawColorButton(Emgui_color32(127, 127, 127, 255), x + 3, y - colorbar_adjust, groupSize); renderName(group->displayName, x, y - name_adjust, groupSize, group->folded, true); return 0; }
void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec ) { wxASSERT( aRow >= 0 ); int col; int index = aRow * RND_COLUMN_COUNT; const int flags = wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT; wxString renderName( aSpec.rowName ); // column 1 col = 1; wxCheckBox* cb = new wxCheckBox( m_RenderScrolledWindow, encodeId( col, aSpec.id ), aSpec.rowName, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); shrinkFont( cb, m_PointSize ); cb->SetValue( aSpec.state ); cb->Enable( aSpec.changeable ); cb->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, &LAYER_WIDGET::OnRenderCheckBox, this ); cb->SetToolTip( aSpec.tooltip ); // column 0 col = 0; if( aSpec.color != COLOR4D::UNSPECIFIED ) { auto bmb = new COLOR_SWATCH( m_RenderScrolledWindow, aSpec.color, encodeId( col, aSpec.id ), AreArbitraryColorsAllowed(), getBackgroundLayerColor() ); bmb->Bind( COLOR_SWATCH_CHANGED, &LAYER_WIDGET::OnRenderSwatchChanged, this ); bmb->SetToolTip( _( "Left double click or middle click for color change" ) ); m_RenderFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags ); bmb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, renderName] ( wxMouseEvent& aEvt ) { OnRightDownRender( aEvt, bmb, renderName ); } ); cb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, renderName] ( wxMouseEvent& aEvt ) { OnRightDownRender( aEvt, bmb, renderName ); } ); // could add a left click handler on the color button that toggles checkbox. } else // == -1, no color selection wanted { // need a place holder within the sizer to keep grid full. wxPanel* invisible = new wxPanel( m_RenderScrolledWindow, encodeId( col, aSpec.id ) ); m_RenderFlexGridSizer->wxSizer::Insert( index+col, invisible, 0, flags ); } // Items have to be inserted in order col = 1; m_RenderFlexGridSizer->wxSizer::Insert( index+col, cb, 0, flags ); }
void TableProtoScene::ScoreBoard::Render() { #ifndef _WIN32 if (!initialized) { objInit(); initialized = true; } #endif /*_WIN32*/ RECT rect = {0, 0, PanelWidth, PanelHeight}; SpriteRenderer::instantiate(myDevice)->ShowSprite(texture, (int)xpos, (int)ypos, PanelWidth, PanelHeight, 0xffffffff, &rect, 0, 0, &myMatrix); if ((playerID() >= 0) && (playerID() < (GameStatus::gameStat()->chkGameType(SanmaT) ? 3 : 4))) { renderWind(); renderRank(); renderScore(); renderName(); } }
static int renderChannel(struct TrackInfo* info, int startX, Track* trackData, bool valuesOnly) { int y, y_offset; int text_size = 0; int size = min_track_size; int startPos = info->startPos; const int trackIndex = trackData->index; const int endPos = info->endPos; struct sync_track* track = 0; const uint32_t color = trackData->color; bool folded = false; if (!valuesOnly) { drawFoldButton(startX + 6, info->startY - (font_size + 5), &trackData->folded, trackData->active); folded = trackData->folded; if (info->trackData->syncData.tracks) track = info->trackData->syncData.tracks[trackData->index]; size = renderName(trackData->displayName, startX, info->startY - (font_size * 2), min_track_size, folded, trackData->active); if (folded) { text_size = size; size = track_size_folded; } if (trackData->active) { if (drawColorButton(color, startX + 4, info->startY - colorbar_adjust, size)) { Dialog_showColorPicker(&trackData->color); if (trackData->color != color) s_needsUpdate = true; } } else { Emgui_fill(border_color, startX + 4, info->startY - colorbar_adjust, size - 8, 8); } } Emgui_setDefaultFont(); y_offset = info->startY; folded = valuesOnly ? true : folded; size = valuesOnly ? track_size_folded : size; if (valuesOnly) { Emgui_fill(border_color, startX + size, info->startY - font_size * 4, 2, (info->endSizeY - info->startY) + 40); Emgui_fill(border_color, startX, info->startY - font_size * 4, 2, (info->endSizeY - info->startY) + 40); } else { Emgui_drawBorder(border_color, border_color, startX, info->startY - font_size * 4, size, (info->endSizeY - info->startY) + 40); } // if folded we should skip rendering the rows that are covered by the text if (folded) { int skip_rows = (text_size + font_size * 2) / font_size; if (startPos + skip_rows > 0) { startPos += skip_rows; y_offset += skip_rows * font_size; } } if (startPos < 0) { y_offset = info->startY + (font_size * -startPos); startPos = 0; } y_offset += font_size_half; for (y = startPos; y < endPos; ++y) { int idx = -1; int offset = startX + 6; bool selected; if (track) idx = sync_find_key(track, y); renderInterpolation(info, track, size, idx, offset, y_offset, folded); if (!(trackData->selected && info->viewInfo->rowPos == y && info->editText)) renderText(info, track, y, idx, offset, y_offset, folded); selected = (trackIndex >= info->selectLeft && trackIndex <= info->selectRight) && (y >= info->selectTop && y <= info->selectBottom); if (selected) Emgui_fill(selection_color, startX, y_offset - font_size_half, size, font_size); if (y != 0) { if (TrackData_hasBookmark(info->trackData, y)) Emgui_fill(bookmark_color, startX, y_offset - font_size_half, size, 8); } y_offset += font_size; if (y_offset > (info->endSizeY + font_size_half)) break; } if (!Emgui_hasKeyboardFocus()) { if (trackData->selected) { Emgui_fill(trackData->group->folded ? dark_active_track_color : active_track_color, startX, info->midPos, size, font_size + 1); if (info->editText) Emgui_drawText(info->editText, startX + 2, info->midPos, Emgui_color32(255, 255, 255, 255)); } } Emgui_setFont(info->viewInfo->smallFontId); return size; }