static void set_line_mode(DrawingContext* context, cap_mode capMode, join_mode joinMode, float miterLimit) { DrawState* state = context->CurrentState(); state->SetLineCapMode(capMode); state->SetLineJoinMode(joinMode); state->SetMiterLimit(miterLimit); context->GetDrawingEngine()->SetStrokeMode(capMode, joinMode, miterLimit); }
static void set_line_mode(View* view, cap_mode capMode, join_mode joinMode, float miterLimit) { DrawState* state = view->CurrentState(); state->SetLineCapMode(capMode); state->SetLineJoinMode(joinMode); state->SetMiterLimit(miterLimit); view->Window()->GetDrawingEngine()->SetStrokeMode(capMode, joinMode, miterLimit); }
static void set_line_mode(void* _canvas, cap_mode capMode, join_mode joinMode, float miterLimit) { Canvas* const canvas = reinterpret_cast<Canvas*>(_canvas); DrawState* state = canvas->CurrentState(); state->SetLineCapMode(capMode); state->SetLineJoinMode(joinMode); state->SetMiterLimit(miterLimit); canvas->GetDrawingEngine()->SetStrokeMode(capMode, joinMode, miterLimit); }
void DebugAttachmentSystem::onCreated() { m_visibleNode = GetGlobal<RenderManager>()->renderer<DebugGeometryRenderer>()->addNode(); m_obscuredNode = GetGlobal<RenderManager>()->renderer<DebugGeometryRenderer>()->addNode(); DrawState obscuredDrawState; obscuredDrawState.setDepthState({DepthTest::Greater, DepthWrite::Enabled}); obscuredDrawState.setBlendState( {BlendEquation::Add, BlendFactor::One, BlendFactor::One}); m_obscuredNode->setDrawState(obscuredDrawState); }
DrawState* DrawState::PushState() { DrawState* next = new (nothrow) DrawState(*this); if (next != NULL) { // Prepare state as derived from this state next->fOrigin = BPoint(0.0, 0.0); next->fScale = 1.0; next->fTransform.Reset(); next->fPreviousState = this; next->SetAlphaMask(fAlphaMask); } return next; }
View::View(DrawState& drawstate, float xf, float yf, float nearc, float farc) : drawstate(drawstate), properties(drawstate.globals, drawstate.defaults) { // default view params eye_sep_ratio = 0.03f; //Eye separation ratio to focal length fov = 45.0f; //60.0 //Field of view - important to adjust for stereo viewing focal_length = focal_length_adj = 0.0; //Stereo zero parallex distance adjustment scene_shift = 0.0; //Stereo projection shift rotated = rotating = sort = false; model_size = 0.0; //Scalar magnitude of model dimensions width = 0; //Viewport width height = 0; //Viewport height scale2d = 1.0; x = xf; y = yf; w = h = 1.0f; stereo = false; autozoom = false; filtered = true; scaled = true; initialised = false; localcam = new Camera(); //Use the local cam by default rotate_centre = localcam->rotate_centre; focal_point = localcam->focal_point; model_trans = localcam->model_trans; rotation = &localcam->rotation; for (int i=0; i<3; i++) { default_focus[i] = FLT_MIN; // Default focal point scale[i] = 1.0; min[i] = 0.0; max[i] = 0.0; } is3d = true; //View properties can only be set if exist, so copy defaults std::string viewprops[] = {"title", "zoomstep", "margin", "rulers", "rulerticks", "rulerwidth", "fontscale", "border", "fillborder", "bordercolour", "axis", "axislength", "timestep", "antialias", "shift"}; //Gets current value (either global or default) for (auto key : viewprops) properties.data[key] = drawstate.global(key); //Clip planes properties.data["near"] = nearc; properties.data["far"] = farc; }
void CanvasMessage::AddDrawState(const DrawState& drawState) { Add(drawState.PenSize()); Add(drawState.SubPixelPrecise()); Add(drawState.GetDrawingMode()); Add(drawState.AlphaSrcMode()); Add(drawState.AlphaFncMode()); AddPattern(drawState.GetPattern()); Add(drawState.LineCapMode()); Add(drawState.LineJoinMode()); Add(drawState.MiterLimit()); Add(drawState.HighColor()); Add(drawState.LowColor()); }