mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:52:43 +00:00 
			
		
		
		
	 4a99875582
			
		
	
	
		4a99875582
		
	
	
	
	
		
			
			This introduces a new device independent base class for Images in LibGPU that also keeps track of the device from which it was created in order to prevent assigning images across devices.
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			773 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			773 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
 | |
|  * Copyright (c) 2022, the SerenityOS developers.
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/RefCounted.h>
 | |
| #include <LibGPU/Image.h>
 | |
| 
 | |
| namespace GL {
 | |
| 
 | |
| class Texture : public RefCounted<Texture> {
 | |
| public:
 | |
|     virtual ~Texture() = default;
 | |
| 
 | |
|     virtual bool is_texture_1d() const { return false; }
 | |
|     virtual bool is_texture_2d() const { return false; }
 | |
|     virtual bool is_texture_3d() const { return false; }
 | |
|     virtual bool is_cube_map() const { return false; }
 | |
| 
 | |
|     RefPtr<GPU::Image> device_image() { return m_device_image; }
 | |
|     void set_device_image(RefPtr<GPU::Image> image) { m_device_image = image; }
 | |
| 
 | |
| private:
 | |
|     RefPtr<GPU::Image> m_device_image;
 | |
| };
 | |
| 
 | |
| }
 |