本文整理汇总了C++中InitColors函数的典型用法代码示例。如果您正苦于以下问题:C++ InitColors函数的具体用法?C++ InitColors怎么用?C++ InitColors使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitColors函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fopen
void Log::Initialize()
{
std::string logfn=sConfig.GetStringDefault("LogFile", "");
if(logfn!="")
{
logfile = fopen(logfn.c_str(), "w");
}
std::string gmlogname = sConfig.GetStringDefault("GMLogFile", "");
if(gmlogname!="")
{
gmlogfile = fopen(gmlogname.c_str(), "a");
}
std::string dberlogname = sConfig.GetStringDefault("DBErrorLogFile", "");
if(dberlogname!="")
{
dberlogfile = fopen(dberlogname.c_str(), "a");
}
m_logLevel = sConfig.GetIntDefault("LogLevel", 0);
m_logFileLevel = sConfig.GetIntDefault("LogFileLevel", 0);
InitColors(sConfig.GetStringDefault("LogColors", ""));
if(sConfig.GetIntDefault("LogFilter_TransportMoves", 0)!=0)
m_logFilter |= LOG_FILTER_TRANSPORT_MOVES;
if(sConfig.GetIntDefault("LogFilter_CreatureMoves", 0)!=0)
m_logFilter |= LOG_FILTER_CREATURE_MOVES;
}
示例2: initInstance
static bool initInstance( void )
{
// OLE2Init();
InitFonts();
InitColors();
return( true );
}
示例3: initInstance
static BOOL initInstance( void )
{
// OLE2Init();
InitFonts();
InitColors();
return( TRUE );
}
示例4: InitColors
void CSynBCGPEditCtrl::OnSysColorChange()
{
CWnd::OnSysColorChange();
InitColors ();
RedrawWindow ();
}
示例5: InitColors
//*****************************************************************************************
void CBCGPListCtrl::OnSysColorChange()
{
CListCtrl::OnSysColorChange();
InitColors ();
RedrawWindow ();
}
示例6: I2X
void CAutomap::Init (void)
{
m_nWidth = 640;
m_nHeight = 480;
m_bFull = false;
m_bDisplay = 0;
m_data.bCheat = 0;
m_data.bHires = 1;
m_data.nViewDist = 0;
m_data.nMaxDist = I2X (2000);
m_data.nZoom = 0x9000;
m_data.viewPos.SetZero ();
m_data.viewTarget.SetZero ();
m_data.viewMatrix = CFixMatrix::IDENTITY;
for (int i = 0; i < 2; i++) {
if (!m_visited [i].Buffer ())
m_visited [i].Create (MAX_SEGMENTS_D2X);
m_visited [i].Clear ();
}
if (!m_visible.Buffer ())
m_visible.Create (MAX_SEGMENTS_D2X);
m_visible.Clear ();
m_nEdges = 0;
m_nMaxEdges = MAX_EDGES;
m_nLastEdge = -1;
m_edges.Create (MAX_EDGES);
m_brightEdges.Create (MAX_EDGES);
InitColors ();
}
示例7: BasicInit
void BasicInit()
#ifdef MAC
{
void InitColors();
#if MACB4CARBON
short i;
Ptr stackTop;
// JLMextern _DataInit();
stackTop = GetApplLimit();
SetApplLimit((void *)(stackTop - (Ptr)30000));
// SetApplLimit((void *)(*(long *)csb - 30000));
MaxApplZone();
for (i = 1 ; i <= 16 ; i++) MoreMasters();
InitGraf(&qd.thePort);
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs(nil);
FlushEvents(everyEvent, 0);
#endif
InitCursor();
InitColors();
}
示例8: InitColors
Draw::Draw(HDC hdc) {
DrawLock __;
native = 0;
InitColors();
InitFonts();
Reset();
Attach(hdc);
}
示例9: Appender
AppenderConsole::AppenderConsole(uint8 id, std::string const& name, LogLevel level, AppenderFlags flags, std::vector<char const*> extraArgs)
: Appender(id, name, level, flags), _colored(false)
{
for (uint8 i = 0; i < NUM_ENABLED_LOG_LEVELS; ++i)
_colors[i] = ColorTypes(MaxColors);
if (!extraArgs.empty())
InitColors(extraArgs[0]);
}
示例10: Appender
AppenderConsole::AppenderConsole(uint8 id, std::string const& name, LogLevel level, AppenderFlags flags, ExtraAppenderArgs extraArgs)
: Appender(id, name, level, flags), _colored(false)
{
for (uint8 i = 0; i < MaxLogLevels; ++i)
_colors[i] = ColorTypes(MaxColors);
if (!extraArgs.empty())
InitColors(extraArgs[0]);
}
示例11: GetTimestampStr
void Log::Initialize()
{
std::string logsDir = sConfig.GetStringDefault("LogsDir","");
if(!logsDir.empty())
{
if((logsDir.at(logsDir.length()-1)!='/') && (logsDir.at(logsDir.length()-1)!='\\'))
logsDir.append("/");
}
std::string logfn=sConfig.GetStringDefault("LogFile", "");
if(logfn!="")
{
if(sConfig.GetIntDefault("LogTimestamp",0))
{
std::string logTimestamp = sConfig.GetIntDefault("LogTimestamp",0) ? GetTimestampStr() : "";
logTimestamp.insert(0,"_");
size_t dot_pos = logfn.find_last_of(".");
if(dot_pos!=logfn.npos)
logfn.insert(dot_pos,logTimestamp);
else
logfn += logTimestamp;
}
logfile = fopen((logsDir+logfn).c_str(), "w");
}
std::string gmlogname = sConfig.GetStringDefault("GMLogFile", "");
if(gmlogname!="")
{
gmLogfile = fopen((logsDir+gmlogname).c_str(), "a");
}
std::string dberlogname = sConfig.GetStringDefault("DBErrorLogFile", "");
if(dberlogname!="")
{
dberLogfile = fopen((logsDir+dberlogname).c_str(), "a");
}
std::string ralogname = sConfig.GetStringDefault("RaLogFile", "");
if(ralogname!="")
{
raLogfile = fopen((logsDir+ralogname).c_str(), "a");
}
m_logLevel = sConfig.GetIntDefault("LogLevel", 0);
m_logFileLevel = sConfig.GetIntDefault("LogFileLevel", 0);
InitColors(sConfig.GetStringDefault("LogColors", ""));
m_logFilter = 0;
if(sConfig.GetIntDefault("LogFilter_TransportMoves", 0)!=0)
m_logFilter |= LOG_FILTER_TRANSPORT_MOVES;
if(sConfig.GetIntDefault("LogFilter_CreatureMoves", 0)!=0)
m_logFilter |= LOG_FILTER_CREATURE_MOVES;
if(sConfig.GetIntDefault("LogFilter_VisibilityChanges", 0)!=0)
m_logFilter |= LOG_FILTER_VISIBILITY_CHANGES;
}
示例12: glClearColor
void SceneBase::Init(string vertexShader, string fragmentShader)
{
// Debug
m_bShowDebug = false;
// Simulation Speed
m_speed = 1.0f;
// Dark Blue Background
glClearColor(0.0f, 0.0f, 0.4f, 0.0f);
// Enable depth test
glEnable(GL_DEPTH_TEST);
// Accept fragment if it closer to the camera than the former one
glDepthFunc(GL_LESS);
// Face Culling
glEnable(GL_CULL_FACE);
m_bCull = true;
// Filled/Wireframe Mode
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
m_bWireframe = false;
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glGenVertexArrays(1, &m_vertexArrayID);
glBindVertexArray(m_vertexArrayID);
Math::InitRNG();
InitShadersAndLights(vertexShader, fragmentShader);
InitFog();
/*
* Resource Initialization
*/
// Colors
InitColors();
// Materials
InitMaterials();
// Textures
InitTextures();
// Meshes
InitMeshes();
// Projection matrix : 45° Field of View, 4:3 ratio, display range : 0.1 unit <-> 1000 units
Mtx44 perspective;
perspective.SetToPerspective(45.0f, 4.0f / 3.0f, 0.1f, 12000.0f);
//perspective.SetToOrtho(-80, 80, -60, 60, -1000, 1000);
projectionStack.LoadMatrix(perspective);
bLightEnabled = true;
}
示例13: DrawBoard
/*
* Function: DrawBoard
* -------------------
* Exported function to draw a new board. Sets up named colors, draws the yellow
* border, draws the empty cubes, the labels on the scoreboard, and resets scores
* to zero and words lists to empty.
*/
void DrawBoard(int numRows, int numCols)
{
if (numRows < 0 || numRows > MAX_DIMENSION || numCols < 0 || numCols > MAX_DIMENSION)
Error("DrawBoard called with invalid dimensions.");
SetWindowTitle("Welcome to Boggle!");
InitColors();
CalculateGeometry(numRows, numCols);
// Draws a filled rect underneath cubes in the oh-so-familiar yellow color
FillBox(gState.board.x, gState.board.y, gState.board.w, gState.board.h, 0.5, "Board Color");
DrawEmptyCubes();
DrawPlayerLabel(Human, "Me");
DrawPlayerLabel(Computer, "Computer");
}
示例14: SetPaintBackgroundEnabled
void CEditorRoot::ApplySchemeSettings(vgui::IScheme *pScheme)
{
BaseClass::ApplySchemeSettings(pScheme);
SetPaintBackgroundEnabled(true);
SetPaintBorderEnabled(false);
SetPaintEnabled(true);
SetCloseButtonVisible(false);
SetSizeable(false);
SetMoveable(false);
InitColors();
SetTitle( "", true );
SetTitleBarVisible( false );
m_pLabelTitle->SetText( GetEditorTitle() );
m_pLabelTitle->SetFont( pScheme->GetFont( "UiBold", false ) );
SetPaintBackgroundType( 0 );
OnShaderNameChanged();
GenerateFonts(pScheme);
}
示例15: wxOwnerDrawnComboBox
: wxOwnerDrawnComboBox(parent, id, wxEmptyString, wxDefaultPosition,
wxDefaultSize, wxArrayString(), wxCB_READONLY)
#endif
{
// If the ctrl is too small the color box gets messed up in wxOSX
SetMinSize(wxSize(GetCharWidth() * 22, -1));
s_ctrls.push_back(this);
// Make sure we have a list of colors
if (s_colors.empty())
InitColors();
else
UpdateCtrls();
// Set the initial value
SetColor(color.IsOk() ? color : *wxWHITE);
// Connect the event handler
#ifndef __WXOSX__
Connect(wxEVT_COMMAND_COMBOBOX_SELECTED,
#else
Connect(wxEVT_COMMAND_CHOICE_SELECTED,
#endif
wxCommandEventHandler(ColorChoice::OnSelection));
}