Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
Texture2D.OpenGL.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGL
4 using System;
5 using System.IO;
6 using System.Runtime.InteropServices;
7 using OpenTK.Graphics;
8 
9 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGLES
10 using OpenTK.Graphics.ES30;
11 #else
12 using OpenTK.Graphics.OpenGL;
13 #endif
14 
15 namespace SiliconStudio.Paradox.Graphics
16 {
17  /// <summary>
18  /// Represents a 2D grid of texels.
19  /// </summary>
20  public partial class Texture2D
21  {
22  protected internal Texture2D(GraphicsDevice device, TextureDescription description2D, DataBox[] dataBoxes = null, bool initialize = true) : base(device, description2D, TextureTarget.Texture2D, dataBoxes, initialize)
23  {
24  }
25 
26  protected internal Texture2D(GraphicsDevice device, Texture2D texture) : base(device, texture)
27  {
28  }
29 
30  public override Texture ToTexture(ViewType viewType, int arraySlice, int mipMapSlice)
31  {
32  // Exists since OpenGL 4.3
33  if (viewType != ViewType.Full || arraySlice != 0 || mipMapSlice != 0)
34  throw new NotImplementedException();
35 
36  return new Texture2D(GraphicsDevice, this);
37  }
38 
39  public DepthStencilBuffer ToDepthStencilBuffer(bool isReadOnly)
40  {
41  return new DepthStencilBuffer(GraphicsDevice, this, isReadOnly);
42  }
43 
44  public Texture2D ToDepthTextureCompatible()
45  {
46  throw new NotImplementedException();
47  }
48  }
49 }
50 
51 #endif
ViewType
Defines how a view is selected from a resource.
Definition: ViewType.cs:31
Same as Deferred mode, except sprites are sorted by texture prior to drawing. This can improve perfor...
The texture dimension is 2D.