Implement IBL diffuse part
[opengl.git] / image.cpp
index 13174c08ae88dec5c6e5a44552dc681389e3a959..1565b859142df1d3897932c4790026ab77a71825 100644 (file)
--- a/image.cpp
+++ b/image.cpp
@@ -6,18 +6,6 @@ Image::Image(const std::string &path) {
        CFURLRef url = CFURLCreateWithFileSystemPath(NULL, str, kCFURLPOSIXPathStyle, false);
        CGImageSourceRef source = CGImageSourceCreateWithURL(url, NULL);
        CGImageRef ref = CGImageSourceCreateImageAtIndex(source, 0, NULL);
-       /* auto provider = CGDataProviderCreateWithFilename(path.c_str()); */
-       /* std::ifstream file(path); */
-       /* long magic; */
-       /* file.read((char*)&magic, 8); */
-       /* file.close(); */
-
-       /* CGImageRef ref; */
-
-       /* if (magic == 0x0a1a0a0d474e5089) // png magic number */
-       /*      ref = CGImageCreateWithPNGDataProvider(provider, nullptr, false, kCGRenderingIntentDefault); */
-       /* else */
-       /*      ref = CGImageCreateWithJPEGDataProvider(provider, nullptr, false, kCGRenderingIntentDefault); */
 
        _width = CGImageGetWidth(ref), _height = CGImageGetHeight(ref);
        info = CGImageGetBitmapInfo(ref);
@@ -36,6 +24,7 @@ unsigned char *Image::data() const {
 GLfloat Image::width() const { return _width; }
 GLfloat Image::height() const { return _height; }
 
+// TODO: Properly implement this for both internal format + format
 GLuint Image::format() const {
        if (CGColorSpaceGetModel(colorSpace) == kCGColorSpaceModelMonochrome) {
                return GL_DEPTH_COMPONENT;