X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=197e04df63830269f92a04ed4279636319ef4344;hp=1c5a9d63212a7f8fd787186ca33902873d6ee1e0;hb=b617c5d7b5283ad260a77f01e42e6170cabbc03d;hpb=f17794d55923d4fb4f63e9d082d8d84a735a04e8 diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 1c5a9d63..197e04df 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -17,7 +17,7 @@ Texture2D::Texture2D(): width(0), height(0) { - target=GL_TEXTURE_2D; + target = GL_TEXTURE_2D; bind(); } @@ -28,10 +28,10 @@ void Texture2D::storage(PixelFormat fmt, unsigned wd, unsigned ht, int brd) if(wd==0 || ht==0) throw InvalidParameterValue("Invalid texture dimensions"); - ifmt=fmt; - width=wd; - height=ht; - border=brd; + ifmt = fmt; + width = wd; + height = ht; + border = brd; } void Texture2D::image(int level, PixelFormat fmt, DataType type, const void *data) @@ -64,9 +64,9 @@ void Texture2D::load_image(const string &fn) void Texture2D::image(const Graphics::Image &img) { - unsigned w=img.get_width(); - unsigned h=img.get_height(); - PixelFormat fmt=pixelformat_from_graphics(img.get_format()); + unsigned w = img.get_width(); + unsigned h = img.get_height(); + PixelFormat fmt = pixelformat_from_graphics(img.get_format()); if(width==0) storage(fmt, w, h, 0); else if(w!=width || h!=height) @@ -94,7 +94,7 @@ void Texture2D::Loader::image_data(const string &data) void Texture2D::Loader::raw_data(const string &data) { - Texture2D &t2d=static_cast(obj); + Texture2D &t2d = static_cast(obj); t2d.image(0, t2d.ifmt, UNSIGNED_BYTE, data.data()); }