这篇教程C++ COLOR函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中COLOR函数的典型用法代码示例。如果您正苦于以下问题:C++ COLOR函数的具体用法?C++ COLOR怎么用?C++ COLOR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了COLOR函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Paintvoid Devildog::Paint(MATRIX3X2 matView){ int width = m_BmpDevildogPtr->GetWidth()/6; int height = m_BmpDevildogPtr->GetHeight()/4; RECT clip; clip.left = width * m_MoveTick; clip.right = clip.left + width; clip.top = height * m_StartLine; clip.bottom = clip.top + height; MATRIX3X2 matDirection, matPos; if(m_Direction == 1) matPos.SetAsTranslate(m_Pos); else matPos.SetAsTranslate(m_Pos.x + width, m_Pos.y); matDirection.SetAsScale(m_Direction,1); GAME_ENGINE->SetTransformMatrix(matDirection * matPos * matView); GAME_ENGINE->DrawBitmap(m_BmpDevildogPtr,0,0,clip); GAME_ENGINE->SetColor(COLOR(255,0,0,125));}
开发者ID:Kwintenvdb,项目名称:Willow-Game-Remake,代码行数:24,
示例2: session_get_linevoid session_get_line(t_client *client){ char *conf; if (!client->session->conf.file) { if (file_exists(client->session->host)) conf = client->session->host; else conf = "default"; client->session->conf.file = fopen(conf, "r"); VERBOSE(printf("/033[%d;1m<%03d> - conf : %s/033[m/n", COLOR(client->session->id), client->session->id, conf)); } if (!fgets(client->session->conf.line, BUF_SIZE, client->session->conf.file)) { fclose(client->session->conf.file); client->session->conf.file = 0; session_get_line(client); } else if (client->session->conf.line[strlen(client->session->conf.line) - 1] == '/n') client->session->conf.line[strlen(client->session->conf.line) - 1] = 0;}
开发者ID:episeclab,项目名称:advanced-csrf,代码行数:24,
示例3: f/*y = f(x) + g(x);*/// === EXCEPTION 1 =============================================================// Macros is not bad for concatenation and stringificationenum Color { Color_Red, Color_Green, Color_Blue };static const struct { enum Color color; const char *name;} colors[] = {#define COLOR(color) { Color_ ## color, #color } COLOR(Red), COLOR(Green), COLOR(Blue)};// === EXCEPTION 2 =============================================================// Macros is not bad for yield a compile-time constants#define ADD_M(a, b) ((a) + (b))static inline int add_f(int a, int b) { return a + b;}/* === OTHER EXCEPTIONS ======================================================== * Macros is not bad for: * * 3. implement type-generic functions
开发者ID:liuhangyu,项目名称:notbad,代码行数:30,
示例4: c_str//.........这里部分代码省略......... case mnemocode::fnstcw : return "fnstcw"; case mnemocode::fldcw : return "fldcw"; case mnemocode::fclex : return "fclex"; case mnemocode::fnclex : return "fnclex"; case mnemocode::fsave : return "fsave"; case mnemocode::fnsave : return "fnsave"; case mnemocode::frstor : return "frstor"; case mnemocode::fstenv : return "fstenv"; case mnemocode::fnstenv : return "fnstenv"; case mnemocode::fldenv : return "fldenv"; case mnemocode::ffree : return "ffree"; case mnemocode::ffreep : return "ffreep"; case mnemocode::fdecstp : return "fdecstp"; case mnemocode::fincstp : return "fincstp"; case mnemocode::fld : return "fld"; case mnemocode::fst : return "fst"; case mnemocode::fstp : return "fstp"; case mnemocode::fxch : return "fxch"; case mnemocode::fcmovb : return "fcmovb"; case mnemocode::fcmove : return "fcmove"; case mnemocode::fcmovbe : return "fcmovbe"; case mnemocode::fcmovu : return "fcmovu"; case mnemocode::fcmovnb : return "fcmovnb"; case mnemocode::fcmovne : return "fcmovne"; case mnemocode::fcmovnbe : return "fcmovnbe"; case mnemocode::fcmovnu : return "fcmovnu"; case mnemocode::fldz : return "fldz"; case mnemocode::fld1 : return "fld1"; case mnemocode::fldpi : return "fldpi"; case mnemocode::fldl2e : return "fldl2e"; case mnemocode::fldl2t : return "fldl2t"; case mnemocode::fldlg2 : return "fldlg2"; case mnemocode::fldln2 : return "fldln2"; case mnemocode::fild : return "fild"; case mnemocode::fist : return "fist"; case mnemocode::fistp : return "fistp"; case mnemocode::fisttp : return "fisttp"; case mnemocode::fbld : return "fbld"; case mnemocode::fbstp : return "fbstp"; case mnemocode::fcom : return "fcom"; case mnemocode::fcomi : return "fcomi"; case mnemocode::fcomip : return "fcomip"; case mnemocode::fcomp : return "fcomp"; case mnemocode::fcompp : return "fcompp"; case mnemocode::ficom : return "ficom"; case mnemocode::ficomp : return "ficomp"; case mnemocode::ftst : return "ftst"; case mnemocode::fucom : return "fucom"; case mnemocode::fucomi : return "fucomi"; case mnemocode::fucomip : return "fucomip"; case mnemocode::fucomp : return "fucomp"; case mnemocode::fucompp : return "fucompp"; case mnemocode::fxam : return "fxam"; case mnemocode::fabs : return "fabs"; case mnemocode::fadd : return "fadd"; case mnemocode::faddp : return "faddp"; case mnemocode::fchs : return "fchs"; case mnemocode::fdiv : return "fdiv"; case mnemocode::fdivp : return "fdivp"; case mnemocode::fdivr : return "fdivr"; case mnemocode::fdivrp : return "fdivrp"; case mnemocode::fmul : return "fmul"; case mnemocode::fmulp : return "fmulp"; case mnemocode::frndint : return "frndint"; case mnemocode::fsqrt : return "fsqrt"; case mnemocode::fsub : return "fsub"; case mnemocode::fsubp : return "fsubp"; case mnemocode::fsubr : return "fsubr"; case mnemocode::fsubrp : return "fsubrp"; case mnemocode::fiadd : return "fiadd"; case mnemocode::fidiv : return "fidiv"; case mnemocode::fidivr : return "fidivr"; case mnemocode::fimul : return "fimul"; case mnemocode::fisub : return "fisub"; case mnemocode::fisubr : return "fisubr"; case mnemocode::fcos : return "fcos"; case mnemocode::fpatan : return "fpatan"; case mnemocode::fptan : return "fptan"; case mnemocode::fsin : return "fsin"; case mnemocode::fsincos : return "fsincos"; case mnemocode::f2xm1 : return "f2xm1"; case mnemocode::fscale : return "fscale"; case mnemocode::fyl2x : return "fyl2x"; case mnemocode::fyl2xp1 : return "fyl2xp1"; case mnemocode::fnop : return "fnop"; case mnemocode::fprem : return "fprem"; case mnemocode::fprem1 : return "fprem1"; case mnemocode::fxtract : return "fxtract"; case mnemocode::trunc : return "trunc"; case mnemocode::sp_inc : return COLOR(3, "sp_inc"); case mnemocode::sp_dec : return COLOR(3, "sp_dec"); case mnemocode::bra : return COLOR(2, "bra" ); case mnemocode::ket : return COLOR(2, "ket" ); case mnemocode::endl : return COLOR(4, "endl" ); case mnemocode::alloca_ : return COLOR(7, "alloca"); case mnemocode::call : return COLOR(1, "call" ); case mnemocode::ret : return COLOR(1, "ret" ); case mnemocode::sahf : return "sahf"; }}
开发者ID:tomilov,项目名称:insituc,代码行数:101,
示例5: grey inline COLOR grey(double g) { return COLOR(g,g,g); }
开发者ID:QuLogic,项目名称:jot-lib,代码行数:1,
示例6: color_ub //! /brief create a COLOR from unsigned bytes r, g, b inline COLOR color_ub(unsigned char r, unsigned char g, unsigned char b) { return COLOR(r/255.0, g/255.0, b/255.0); }
开发者ID:QuLogic,项目名称:jot-lib,代码行数:4,
示例7: get_var_color // Given a Config variable name and a default COLOR value, // return the corresponding COLOR if the variable is defined, // otherwise return the default value: inline CCOLOR get_var_color(const string& var_name, CCOLOR& default_val) { string col_str = Config::get_var_str(var_name, color_to_str(default_val)); double r, g, b; sscanf(col_str.c_str(), "%lf%lf%lf", &r, &g, &b); return COLOR(r,g,b); }
开发者ID:QuLogic,项目名称:jot-lib,代码行数:9,
示例8: CAMERA::CAMERA(void){ color=COLOR(0,0,0,0); min=0.001f,max=1000,fovh=angle2rad(60),fovv=angle2rad(60.0f*0.75f);}
开发者ID:ponycalypsenow,项目名称:oldies,代码行数:4,
示例9: mainvoid main() { while (1) { COLOR(RND()); draw_circle(RND() & 0xff, RND() & 0xff, (RND() & 0x1f) + 16); }}
开发者ID:rfotino,项目名称:consolite-compiler,代码行数:6,
示例10: _tnl_Color4fvstatic void_tnl_Color4fv( const GLfloat *v ){ GET_IMMEDIATE; COLOR( IM, v[0], v[1], v[2], v[3] );}
开发者ID:carriercomm,项目名称:finx,代码行数:6,
示例11: _tnl_Color4fstatic void_tnl_Color4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ){ GET_IMMEDIATE; COLOR( IM, red, green, blue, alpha );}
开发者ID:carriercomm,项目名称:finx,代码行数:6,
示例12: _tnl_Color3fstatic void_tnl_Color3f( GLfloat red, GLfloat green, GLfloat blue ){ GET_IMMEDIATE; COLOR( IM, red, green, blue, 1.0 );}
开发者ID:carriercomm,项目名称:finx,代码行数:6,
示例13: config_string_cb//.........这里部分代码省略......... case '1': config.modifier = Mod1Mask; return 1; case '2': config.modifier = Mod2Mask; return 1; case '3': config.modifier = Mod3Mask; return 1; /* case '4': config.modifier = Mod4Mask; return 1; */ case '5': config.modifier = Mod5Mask; return 1; } } config.modifier = Mod4Mask; return 1; } if (!strcmp(cur_key, "wheel_up_cmd")) { DLOG("wheel_up_cmd = %.*s/n", len, val); FREE(config.wheel_up_cmd); sasprintf(&config.wheel_up_cmd, "%.*s", len, val); return 1; } if (!strcmp(cur_key, "wheel_down_cmd")) { DLOG("wheel_down_cmd = %.*s/n", len, val); FREE(config.wheel_down_cmd); sasprintf(&config.wheel_down_cmd, "%.*s", len, val); return 1; } if (!strcmp(cur_key, "position")) { DLOG("position = %.*s/n", len, val); config.position = (len == 3 && !strncmp((const char *)val, "top", strlen("top")) ? POS_TOP : POS_BOT); return 1; } if (!strcmp(cur_key, "status_command")) { DLOG("command = %.*s/n", len, val); sasprintf(&config.command, "%.*s", len, val); return 1; } if (!strcmp(cur_key, "font")) { DLOG("font = %.*s/n", len, val); sasprintf(&config.fontname, "%.*s", len, val); return 1; } if (!strcmp(cur_key, "outputs")) { DLOG("+output %.*s/n", len, val); int new_num_outputs = config.num_outputs + 1; config.outputs = srealloc(config.outputs, sizeof(char *) * new_num_outputs); sasprintf(&config.outputs[config.num_outputs], "%.*s", len, val); config.num_outputs = new_num_outputs; return 1; } if (!strcmp(cur_key, "tray_output")) { DLOG("tray_output %.*s/n", len, val); FREE(config.tray_output); sasprintf(&config.tray_output, "%.*s", len, val); return 1; }#define COLOR(json_name, struct_name) / do { / if (!strcmp(cur_key, #json_name)) { / DLOG(#json_name " = " #struct_name " = %.*s/n", len, val); / sasprintf(&(config.colors.struct_name), "%.*s", len, val); / return 1; / } / } while (0) COLOR(statusline, bar_fg); COLOR(background, bar_bg); COLOR(separator, sep_fg); COLOR(focused_workspace_border, focus_ws_border); COLOR(focused_workspace_bg, focus_ws_bg); COLOR(focused_workspace_text, focus_ws_fg); COLOR(active_workspace_border, active_ws_border); COLOR(active_workspace_bg, active_ws_bg); COLOR(active_workspace_text, active_ws_fg); COLOR(inactive_workspace_border, inactive_ws_border); COLOR(inactive_workspace_bg, inactive_ws_bg); COLOR(inactive_workspace_text, inactive_ws_fg); COLOR(urgent_workspace_border, urgent_ws_border); COLOR(urgent_workspace_bg, urgent_ws_bg); COLOR(urgent_workspace_text, urgent_ws_fg); printf("got unexpected string %.*s for cur_key = %s/n", len, val, cur_key); return 0;}
开发者ID:smrt28,项目名称:i3,代码行数:101,
|