throw invalid_operation("TextureCube::storage");
if(sz==0)
throw invalid_argument("TextureCube::storage");
+ require_pixelformat(fmt);
ifmt = fmt;
size = sz;
unsigned s = get_level_size(level);
if(s==0)
- throw invalid_argument("TextureCube::image");
+ throw out_of_range("TextureCube::image");
Bind _bind(this, true);
glTexImage2D(face, level, ifmt, s, s, 0, fmt, type, data);
const Vector3 &fv = get_face_direction(face);
const Vector3 &sv = get_s_direction(face);
const Vector3 &tv = get_t_direction(face);
- return Vector3(fv.x+s*sv.x, fv.y+t*tv.y, fv.z+s*sv.z+t*tv.z);
+ return fv+s*sv+t*tv;
}
} // namespace GL