Amazon VERSION 2.0V1 Guide de l'utilisateur Page 148

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 264
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 147
1 2 ... 143 144 145 146 147 148 149 150 151 152 153 ... 263 264

Commentaires sur ces manuels

Pas de commentaire