| 128 | |
| 129 | |
| 130 | int imageSizeInBytes(const int width, const int height, const int depth, const GLenum format, const GLenum type) |
| 131 | { |
| 132 | if (type == GL_BITMAP) |
| 133 | { |
| 134 | // handle differently? |
| 135 | warning() << "imageSizeInBytes: GL_BITMAP not implemented yet"; |
| 136 | return -1; |
| 137 | } |
| 138 | |
| 139 | int pixelSize = bytesPerPixel(format, type); |
| 140 | |
| 141 | int rowSize = pixelSize * width; |
| 142 | |
| 143 | int alignment = getInteger(GL_PACK_ALIGNMENT); // can be 1, 2, 4 or 8 |
| 144 | |
| 145 | rowSize = nextMultiple(rowSize, alignment); |
| 146 | |
| 147 | return rowSize * height * depth; |
| 148 | } |
| 149 | |
| 150 | |
| 151 | } // namespace globjects |
no test coverage detected