/******************************************************************** * * MainTask */ void MainTask(void) { GUI_MEMDEV_Handle hMem; GUI_Init(); _Explain(); /* Explain the sample */ GUI_SetFont(&GUI_Font16B_ASCII); GUI_SetColor(GUI_WHITE); GUI_DispStringAt("Screen output:", 5, 59); _Draw(); /* Draw "Preview" on the screen */ /* Create and select a memory device with 1bpp color conversion (B/W) */ hMem = GUI_MEMDEV_CreateFixed(0, 75, 320, 64, 0, GUI_MEMDEV_APILIST_1, /* Used API list */ GUI_COLOR_CONV_1); /* Black/white color conversion */ GUI_MEMDEV_Select(hMem); _Draw(); /* Call the same routine as before for drawing into memory device */ GUI_MEMDEV_Select(0); /* Switch back from memory device to the display */ GUI_SetFont(&GUI_Font16B_ASCII); GUI_SetColor(GUI_WHITE); GUI_DispStringAt("Printer output:", 5, 154); _SendToPrinter(hMem, 170); /* Cleanup, end-of sample */ GUI_MEMDEV_Delete(hMem); while(1) { GUI_Exec(); } }
void CEngine::_MainLoop() { _Running = true; _pGameInterface->Init(); if (_ProcessInterval == 0) { SetProcessInterval(30); } double dTime = glfwGetTime(); while (_Running) { _Draw(); if ((glfwGetTime() - dTime) > _ProcessInterval) { _Process(); dTime = glfwGetTime(); } } _pGameInterface->Free(); glfwTerminate(); }
int UIButton::Draw_Pushed() { SDL_Color &Line = Colors.Pushed; _Draw( Line ); return 0; }
int UIButton::Draw_Hover() { SDL_Color &Line = Colors.Hover; _Draw( Line ); return 0; }
int UIButton::Draw() { SDL_Color &Line = Colors.Normal; _Draw( Line ); return 0; }
/**\brief Draw the image within a box but not stretched */ void Image::DrawFit( int x, int y, int box_w, int box_h, float angle ) { float resize_ratio_w = (float)box_w / (float)this->w; float resize_ratio_h = (float)box_h / (float)this->h; // Use Minimum of the two ratios float resize_ratio = resize_ratio_w<resize_ratio_h ? resize_ratio_w : resize_ratio_h; _Draw(x, y, 1.f, 1.f, 1.f, 1.f, angle, resize_ratio, resize_ratio); }
void vsEntity::Draw( vsDisplayList *list ) { if ( m_visible ) { _Draw(list); DrawChildren(list); } }
//--------------------------------------------------------- void CVIEW_ScatterPlot::On_Paint(wxPaintEvent &event) { wxPaintDC dc(this); wxRect r(wxPoint(0, 0), GetClientSize()); Draw_Edge(dc, EDGE_STYLE_SUNKEN, r); _Draw(dc, r); }
void Octree::_Draw(OctreeGroup* Child) { __Draw(Child); if (Child->haveChilds) { for (uint32 i = 0; i < 8; i++) { _Draw(Child->childs[i]); } } }
void scRenderSystem::RenderOneFrame() { // 清空back buffer float clearColor[4] = { 0.0f, 0.0f, 0.25f, 1.0f }; // 清空depth buffer mContext->ClearRenderTargetView(mBackBuffer, clearColor); mContext->ClearDepthStencilView(mDepthBuffer, D3D11_CLEAR_DEPTH, 1.0f, 0); _Draw(); mSwapChain->Present(0, 0); }
/**\brief Draw the image stretched within to a box */ void Image::DrawStretch( int x, int y, int box_w, int box_h, float angle ) { if(!this) return; assert(this); assert(this->w); assert(this->h); float wf = static_cast<float>(this->w); float hf = static_cast<float>(this->h); float resize_ratio_w = static_cast<float>(box_w) / wf; float resize_ratio_h = static_cast<float>(box_h) / hf; _Draw(x, y, 1.f, 1.f, 1.f, 1.f, angle, resize_ratio_w, resize_ratio_h); }
void GroupListView::_Draw(BLayoutItem* item, BRect updateRect) { if (RendererLayoutItem* rendererItem = dynamic_cast<RendererLayoutItem*>(item)) { ListItemRenderer* renderer = rendererItem->Renderer(); renderer->Draw(this, rendererItem->Frame(), rendererItem->Index(), false); } else if (BLayout* layout = dynamic_cast<BLayout*>(item)) { for (int i = 0; i < layout->CountItems(); i++) { item = layout->ItemAt(i); if (!item->IsVisible() || !item->Frame().Intersects(updateRect)) continue; _Draw(item, updateRect); } } }
void Octree::Draw(Projection projection, Matrix camera) { #if !defined(GLES2) glMatrixMode(GL_PROJECTION); glLoadIdentity(); glLoadMatrixf(&projection.m.m[0]); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glLoadMatrixf(&camera.m[0]); if (Root != NULL) { _Draw(Root); } #endif }
//--------------------------------------------------------- void CVIEW_ScatterPlot::On_ToClipboard(wxCommandEvent &event) { wxBitmap BMP(GetSize()); wxMemoryDC dc; dc.SelectObject(BMP); dc.SetBackground(*wxWHITE_BRUSH); dc.Clear(); _Draw(dc, wxRect(BMP.GetSize())); dc.SelectObject(wxNullBitmap); if( wxTheClipboard->Open() ) { wxBitmapDataObject *pBMP = new wxBitmapDataObject; pBMP->SetBitmap(BMP); wxTheClipboard->SetData(pBMP); wxTheClipboard->Close(); } }
// Rendering method void Box::Draw(int x_translate, int y_translate) { int old_xpos, old_ypos; if ( !_Assert() ) return; if (x_translate != 0 || y_translate != 0) { old_xpos = _xpos; old_ypos = _ypos; _SetValues(_xsize, _ysize, _xpos + x_translate, _ypos + y_translate); } _Draw(); if (x_translate != 0 || y_translate != 0) { _SetValues(_xsize, _ysize, old_xpos, old_ypos); } }
/**\brief Draw the image (angle is in degrees) */ void Image::Draw( int x, int y, float angle ) { _Draw( x, y, 1.f, 1.f, 1.f, 1.f, angle ); }
static void _Draw2(void * p) { PARAM * pParam = (PARAM *)p; _Draw(p); GUI_SetColor(COLOR_GRAPH1); GUI_DrawGraph(pParam->aY+15, (LCD_GetXSize() - 20), 19, (LCD_GetYSize() - 20) - _YSize); }
/******************************************************************* * * _Draw2 */ static void _Draw2(void * p) { PARAM * pParam = (PARAM *)p; _Draw(p); GUI_SetColor(COLOR_GRAPH1); GUI_DrawGraph(pParam->aY+15, (LCD_XSIZE - 20), 19, (LCD_YSIZE - 20) - YSIZE); }
/********************************************************************* * * _Show */ static void _Show(void) { if (_CursorOn && (_CursorDeActCnt==0)) { _CursorIsVis = 1; _Draw(); } }
void GroupListView::Draw(BRect updateRect) { _Draw(GetLayout(), updateRect); }
/**\brief Draw the image (angle is in degrees, alpha is between 0.0 and 1.0) */ void Image::DrawAlpha( int x, int y, float alpha ) { _Draw( x, y, 1.f, 1.f, 1.f, alpha ); }