void Image::draw(int x, int y, const Transform& transform, Screen& dest) { dest.bindImage(*this); dest.applyTransform(transform, x, y, impl->canvas.getWidth(), impl->canvas.getHeight()); drawRaw(0, 0, dest); dest.unbindImage(); }
void CacheItem::draw(QPainter *painter, const GuiContext& ctx, const QRect* visibleRect) { if (drawProxy) drawProxy(this, painter, ctx, visibleRect); else drawRaw(painter, ctx, visibleRect); }
OneFriendDrawer::OneFriendDrawer(const cocos2d::CCSize &row_size, const OneFriendPtr &one_friend): _friend(one_friend) { drawRaw(row_size); }
//-------------------------------------------------------------- void testApp::draw(){ ofEnableBlendMode(OF_BLENDMODE_ALPHA); if(outputMode == 0){ ofBackground(0); }else if(outputMode == 1){ glPushMatrix(); glTranslatef(ofGetScreenWidth()/2 - screenWidth/2, 0, 0); drawTest(); glPopMatrix(); }else if(outputMode == 2){ ofBackground(0); glPushMatrix(); glTranslatef(ofGetScreenWidth()/2 - screenWidth/2, 0, 0); drawRaw(); glPopMatrix(); }else if(outputMode == 3){ ofBackground(0); glPushMatrix(); glTranslatef(ofGetScreenWidth()/2 - screenWidth/2, 0, 0); drawBlurred(); glPopMatrix(); }else if(outputMode == 4 || outputMode == 5){ ofBackground(0); fbo_tex.begin(); ofClear(0, 0, 0, 255); glPushMatrix(); if(outputMode == 4){ drawBlurred(); }else{ drawTest(); } //drawRaw(); glPopMatrix(); fbo_tex.end(); ofPixels pixels; fbo_tex.readToPixels(pixels); map_tex.loadData(pixels); ofBackground(0); ofSetColor(255,255,255,255); //bind and draw texture //glEnable(GL_DEPTH_TEST); glPushMatrix(); glTranslatef(ofGetScreenWidth()/2 - screenWidth/2, 0, 0); map_tex.bind(); glBegin(GL_QUADS); for(int y = 0; y < gridSize - 1; y++){ for(int x = 0; x < gridSize - 1; x++){ int i = x + (gridSize * y); glTexCoord2f(t_points[i].x,t_points[i].y); glVertex2i(v_points[i].x, v_points[i].y); // top left i += 1; glTexCoord2f(t_points[i].x,t_points[i].y); glVertex2i(v_points[i].x, v_points[i].y); // top right i += gridSize; glTexCoord2f(t_points[i].x,t_points[i].y); glVertex2i(v_points[i].x, v_points[i].y); // bottom right i -= 1; glTexCoord2f(t_points[i].x,t_points[i].y); glVertex2i(v_points[i].x, v_points[i].y); // bottom left } } glEnd(); map_tex.unbind(); glPopMatrix(); //glDisable(GL_DEPTH_TEST); }else if(outputMode == 6){ ofBackground(255); glPushMatrix(); glTranslatef(ofGetScreenWidth()/2 - screenWidth/2, 0, 0); //sp.draw(0, 0, screenWidth,screenHeight); ofBackground(255); fbo_tex.begin(); ofClear(0, 0, 0, 255); glPushMatrix(); drawTest(); //drawRaw(); glPopMatrix(); fbo_tex.end(); ofPixels pixels; fbo_tex.readToPixels(pixels); map_tex.loadData(pixels); ofSetColor(255,255,255,255); //bind and draw texture //glEnable(GL_DEPTH_TEST); glPushMatrix(); glTranslatef(ofGetScreenWidth()/2 - screenWidth/2, 0, 0); map_tex.bind(); glBegin(GL_QUADS); for(int y = 0; y < gridSize - 1; y++){ for(int x = 0; x < gridSize - 1; x++){ int i = x + (gridSize * y); glTexCoord2f(t_points[i].x,t_points[i].y); glVertex2i(v_points[i].x, v_points[i].y); // top left i += 1; glTexCoord2f(t_points[i].x,t_points[i].y); glVertex2i(v_points[i].x, v_points[i].y); // top right i += gridSize; glTexCoord2f(t_points[i].x,t_points[i].y); glVertex2i(v_points[i].x, v_points[i].y); // bottom right i -= 1; glTexCoord2f(t_points[i].x,t_points[i].y); glVertex2i(v_points[i].x, v_points[i].y); // bottom left } } glEnd(); map_tex.unbind(); //draw image + quad points for(int i = 0; i < v_points.size() - 1; i++){ (i == selPoint ) ? ofSetColor(255, 0, 0):ofSetColor(0,255,0); ofCircle(v_points[i].x , v_points[i].y, 2); ofSetColor(150); } glPopMatrix(); } ofSetColor(100, 100, 100); //ofDrawBitmapString(ofToString(ofGetFrameRate(),2), 20,20); }