X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=08383526728bb7a239b8551c910c75c6a2ff2f03;hb=a9bf08d7c8d54204b76f91dab95052b737595bea;hp=94224147c70434b53bcb8ef9ea78328e9f81284b;hpb=85c6c43eb0f937f31f4a91ef3731d8bb2e98c8b4;p=libs%2Fgl.git diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 94224147..08383526 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -104,7 +104,7 @@ void Texture2D::image(unsigned level, PixelFormat fmt, DataType type, const void glTexImage2D(target, level, ifmt, w, h, 0, get_upload_format(fmt), type, data); allocated |= 1<(pixel_buffer.map(WRITE_ONLY)); + pixel_buffer.storage(n_bytes); + mapped_address = reinterpret_cast(pixel_buffer.map()); } else if(phase==2) { @@ -270,7 +270,12 @@ bool Texture2D::AsyncLoader::process() } if(!texture.id) - glGenTextures(1, &texture.id); + { + if(ARB_direct_state_access) + glCreateTextures(texture.target, 1, &texture.id); + else + glGenTextures(1, &texture.id); + } texture.image(image, srgb_conversion, true); }