fork download
  1. glBindTexture(GL_TEXTURE_2D, m_uTexture);
  2. glTexImage2D(GL_TEXTURE_2D, 0, 3, m_iArnoldWidth, m_iArnoldHeight, 0, GL_RGBA, GL_FLOAT, data);
  3.  
  4. int size = 32;
  5. float* dataf = new float[size * size * 4];
  6. for (int i = 0; i < size * size * 4; ++i)
  7. {
  8. dataf[i] = 0.6f;
  9. }
  10. //glBindTexture(GL_TEXTURE_2D, m_uTexture);
  11. glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, size, size, GL_RGBA, GL_FLOAT, dataf);
  12. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  13. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:17: error: expected constructor, destructor, or type conversion before ‘(’ token
    glBindTexture(GL_TEXTURE_2D, m_uTexture);
                 ^
prog.cpp:2:16: error: expected constructor, destructor, or type conversion before ‘(’ token
    glTexImage2D(GL_TEXTURE_2D, 0, 3, m_iArnoldWidth, m_iArnoldHeight, 0, GL_RGBA, GL_FLOAT, data);
                ^
prog.cpp:6:4: error: expected unqualified-id before ‘for’
    for (int i = 0; i < size * size * 4; ++i)
    ^
prog.cpp:6:20: error: ‘i’ does not name a type
    for (int i = 0; i < size * size * 4; ++i)
                    ^
prog.cpp:6:41: error: expected unqualified-id before ‘++’ token
    for (int i = 0; i < size * size * 4; ++i)
                                         ^
prog.cpp:11:19: error: expected constructor, destructor, or type conversion before ‘(’ token
    glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, size, size, GL_RGBA, GL_FLOAT, dataf);
                   ^
prog.cpp:12:19: error: expected constructor, destructor, or type conversion before ‘(’ token
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                   ^
prog.cpp:13:19: error: expected constructor, destructor, or type conversion before ‘(’ token
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
                   ^
stdout
Standard output is empty