]> git.tdb.fi Git - libs/gl.git/blob - source/core/texture2dmultisample.cpp
Replace some local pointers with references in VulkanCommands
[libs/gl.git] / source / core / texture2dmultisample.cpp
1 #include "device.h"
2 #include "error.h"
3 #include "texture2dmultisample.h"
4
5 using namespace std;
6
7 namespace Msp {
8 namespace GL {
9
10 void Texture2DMultisample::storage(PixelFormat fmt, unsigned wd, unsigned ht, unsigned sm)
11 {
12         if(width>0)
13         {
14                 if(fmt!=format || wd!=width || ht!=height || sm!=samples)
15                         throw incompatible_data("Texture2DMultisample::storage");
16                 return;
17         }
18         if(wd==0 || ht==0)
19                 throw invalid_argument("Texture2DMultisample::storage");
20         if(!sm || sm>Device::get_current().get_info().limits.max_samples)
21                 throw invalid_argument("Texture2DMultisample::storage");
22
23         set_format(fmt);
24         width = wd;
25         height = ht;
26         samples = sm;
27
28         allocate();
29 }
30
31 void Texture2DMultisample::image(unsigned, const void *)
32 {
33         throw invalid_operation("Texture2DMultisample::image");
34 }
35
36 void Texture2DMultisample::image(const Graphics::Image &, unsigned)
37 {
38         throw invalid_operation("Texture2DMultisample::image");
39 }
40
41 } // namespace GL
42 } // namespace Msp