Amazon VERSION 2.0V1 Podręcznik Użytkownika Strona 148

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 264
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 147
148
for (int i = 0; i < 4; ++i)
{
csValues[i][0] = 1.0f;
csValues[i][1] = 0.0f;
csValues[i][2] = 0.0f;
}
//tokenize input string
std::vector<char *> tokens;
//copy the paramstr because strtok wants to mark it up
char * inputParamStr = strdup(paramstr);
char * separator = const_cast<char *>(" ");
char * inputSource = inputParamStr, * cursor;
while ((cursor = strtok(inputSource, separator)))
{
inputSource = NULL;
tokens.push_back(cursor);
}
for (unsigned int i = 0; i < tokens.size(); ++i)
{
if (!strcmp(tokens[i], "-color"))
{
++i;
if (i+2 < tokens.size())
{
for (unsigned int j = 0; j < 3; ++j, ++i)
{
float value = atof(tokens[i]);
for (int k = 0; k < 4; ++k)
{
csValues[k][j] = value;
}
}
--i;
}
}
else if (!strcmp(tokens[i], "-radius"))
20 ARGS FILES IN SHADERS | EDIT SHADER INTERFACE INTERACTIVELY IN THE UI
Przeglądanie stron 147
1 2 ... 143 144 145 146 147 148 149 150 151 152 153 ... 263 264

Komentarze do niniejszej Instrukcji

Brak uwag