fork download
  1. int size = 64;
  2. float* dataf = new float[size * size * 4];
  3. for (int i = 0; i < size * size * 4; ++i)
  4. {
  5. dataf[i] = 0.6f;
  6. }
  7. glBindTexture(GL_TEXTURE_2D, m_uTexture);
  8. glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, size, size, GL_BGRA, GL_FLOAT, dataf);
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:3: error: expected unqualified-id before ‘for’
   for (int i = 0; i < size * size * 4; ++i)
   ^
prog.cpp:3:19: error: ‘i’ does not name a type
   for (int i = 0; i < size * size * 4; ++i)
                   ^
prog.cpp:3:40: error: expected unqualified-id before ‘++’ token
   for (int i = 0; i < size * size * 4; ++i)
                                        ^
prog.cpp:7:16: error: expected constructor, destructor, or type conversion before ‘(’ token
   glBindTexture(GL_TEXTURE_2D, m_uTexture);
                ^
prog.cpp:8:18: error: expected constructor, destructor, or type conversion before ‘(’ token
   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, size, size, GL_BGRA, GL_FLOAT, dataf);
                  ^
stdout
Standard output is empty