~unity-team/nux/nux.redirected-views

« back to all changes in this revision

Viewing changes to NuxGraphics/GpuDevice.h

  • Committer: Tarmac
  • Author(s): Eleni Maria Stea
  • Date: 2012-10-01 16:50:33 UTC
  • mfrom: (653.2.50 nuxref)
  • Revision ID: tarmac-20121001165033-cbst7tkwdo5k71jj
Resolved conflicts, merged to trunk. Fixes: . Approved by Jay Taoko.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
#endif
115
115
 
116
116
    int GetMaxFboAttachment() {return _opengl_max_fb_attachment;}
 
117
    int GetMaxTextureSize() {return _opengl_max_texture_size;}
117
118
 
118
119
 
119
120
  private:
133
134
    bool _support_opengl_version_40;
134
135
    bool _support_opengl_version_41;
135
136
 
 
137
    int _opengl_max_texture_size;
136
138
    int _opengl_max_texture_units;
137
139
    int _opengl_max_texture_coords;
138
140
    int _opengl_max_texture_image_units;
176
178
  private:
177
179
    static STREAMSOURCE _StreamSource[MAX_NUM_STREAM];
178
180
 
179
 
    int CreateTexture(
180
 
      unsigned int Width
181
 
      , unsigned int Height
182
 
      , unsigned int Levels
183
 
      , BitmapFormat PixelFormat
184
 
      , IOpenGLTexture2D **ppTexture
185
 
      , NUX_FILE_LINE_PROTO
186
 
    );
187
 
 
188
 
    int CreateRectangleTexture(
189
 
      unsigned int Width
190
 
      , unsigned int Height
191
 
      , unsigned int Levels
192
 
      , BitmapFormat PixelFormat
193
 
      , IOpenGLRectangleTexture **ppTexture
194
 
      , NUX_FILE_LINE_PROTO
195
 
    );
196
 
 
197
 
    int CreateCubeTexture(
198
 
      unsigned int EdgeLength
199
 
      , unsigned int Levels
200
 
      , BitmapFormat PixelFormat
201
 
      , IOpenGLCubeTexture **ppCubeTexture
202
 
      , NUX_FILE_LINE_PROTO
203
 
    );
204
 
 
205
 
    int CreateVolumeTexture(
206
 
      unsigned int Width
207
 
      , unsigned int Height
208
 
      , unsigned int Depth
209
 
      , unsigned int Levels
210
 
      , BitmapFormat PixelFormat
211
 
      , IOpenGLVolumeTexture **ppVolumeTexture
212
 
      , NUX_FILE_LINE_PROTO
213
 
    );
214
 
 
215
 
    int CreateAnimatedTexture(
216
 
      unsigned int Width
217
 
      , unsigned int Height
218
 
      , unsigned int Depth
219
 
      , BitmapFormat PixelFormat
220
 
      , IOpenGLAnimatedTexture **ppAnimatedTexture
221
 
    );
222
 
 
223
 
    int CreateVertexBuffer(
224
 
      unsigned int Length
225
 
      , VBO_USAGE Usage    // Dynamic or WriteOnly
226
 
      , IOpenGLVertexBuffer **ppVertexBuffer
227
 
    );
228
 
 
229
 
    int CreateIndexBuffer(
230
 
      unsigned int Length
231
 
      , VBO_USAGE Usage    // Dynamic or WriteOnly
232
 
      , INDEX_FORMAT Format
233
 
      , IOpenGLIndexBuffer **ppIndexBuffer
234
 
    );
235
 
 
236
 
    int CreatePixelBufferObject(int Size, VBO_USAGE Usage,   // Dynamic or WriteOnly
237
 
                                 IOpenGLPixelBufferObject **ppPixelBufferObject
238
 
                                );
239
 
 
240
 
    int CreateQuery(
241
 
      QUERY_TYPE Type,
242
 
      IOpenGLQuery **ppQuery);
243
 
 
244
 
    int CreateVertexDeclaration(
245
 
      const VERTEXELEMENT *pVertexElements,
246
 
      IOpenGLVertexDeclaration **ppDecl);
247
 
 
248
 
    int CreateFrameBufferObject(
249
 
      IOpenGLFrameBufferObject **ppFrameBufferObject);
250
 
 
251
181
  public:
252
182
    ObjectPtr<IOpenGLTexture2D> CreateTexture(
253
183
      int Width,
382
312
    void ActivateFrameBuffer();
383
313
 
384
314
    //! Restore the backbuffer as the render target.
385
 
    void DeactivateFrameBuffer(); 
 
315
    void DeactivateFrameBuffer();
386
316
 
387
317
    unsigned int GetPixelStoreAlignment() const;
388
318
 
448
378
    */
449
379
    BaseTexture* CreateSystemCapableTexture(NUX_FILE_LINE_PROTO);
450
380
 
451
 
    bool SUPPORT_GL_ARB_TEXTURE_NON_POWER_OF_TWO() const
 
381
    bool SUPPORT_GL_ARB_TEXTURE_NON_POWER_OF_TWO()  const
452
382
    {
453
383
      return gpu_info_->Support_ARB_Texture_Non_Power_Of_Two();
454
384
    }
458
388
      return gpu_info_->Support_EXT_Texture_Rectangle();
459
389
    }
460
390
 
461
 
    bool SUPPORT_GL_ARB_TEXTURE_RECTANGLE()    const
 
391
    bool SUPPORT_GL_ARB_TEXTURE_RECTANGLE()  const
462
392
    {
463
393
      return gpu_info_->Support_ARB_Texture_Rectangle();
464
394
    }
465
 
    
 
395
 
466
396
  private:
 
397
    //
 
398
    int _glsl_version_major;  //!< GLSL major version.
 
399
    int _glsl_version_minor;  //!< GLSL major version.
467
400
 
468
 
    // 
469
401
    int opengl_major_;  //!< OpenGL major version.
470
402
    int opengl_minor_;  //!< OpenGL minor version.
471
403
 
478
410
    unsigned int pixel_store_alignment_;
479
411
    std::vector<PixelBufferObject> _PixelBufferArray;
480
412
 
481
 
 
482
413
    bool OGL_EXT_SWAP_CONTROL;
483
414
    bool GL_ARB_VERTEX_PROGRAM;
484
415
    bool GL_ARB_FRAGMENT_PROGRAM;
498
429
    GpuInfo* gpu_info_;
499
430
 
500
431
  public:
501
 
    
 
432
 
502
433
    ObjectPtr<IOpenGLTexture2D> backup_texture0_;
503
434
 
504
435
#if defined(NUX_OS_WINDOWS)
534
465
          bool opengl_es_20 = false);
535
466
    #endif
536
467
#endif
537
 
    
538
468
    ~GpuDevice();
539
469
    friend class IOpenGLSurface;
540
470
    friend class GraphicsEngine;
543
473
}
544
474
 
545
475
#endif // GLDEVICEFACTORY_H
546