~haggai-eran/nux/rtl-rebased

« back to all changes in this revision

Viewing changes to NuxGraphics/GpuDevice.cpp

  • Committer: Jay Taoko
  • Date: 2011-10-21 23:49:15 UTC
  • mfrom: (508.1.2 nux-20)
  • Revision ID: jay.taoko@canonical.com-20111021234915-hnzakb5ndebica8i
* Removed custom Nux types: t_u32, t_s32, t_bool, ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
270
270
  }
271
271
 
272
272
#if defined(NUX_OS_WINDOWS)
273
 
  GpuDevice::GpuDevice(t_u32 DeviceWidth, t_u32 DeviceHeight, BitmapFormat DeviceFormat,
 
273
  GpuDevice::GpuDevice(unsigned int DeviceWidth, unsigned int DeviceHeight, BitmapFormat DeviceFormat,
274
274
    HDC device_context,
275
275
    HGLRC &opengl_rendering_context,
276
276
    int req_opengl_major,
278
278
    bool opengl_es_20)
279
279
#elif defined(NUX_OS_LINUX)
280
280
#ifdef NUX_OPENGLES_20
281
 
  GpuDevice::GpuDevice(t_u32 DeviceWidth, t_u32 DeviceHeight, BitmapFormat DeviceFormat,
 
281
  GpuDevice::GpuDevice(unsigned int DeviceWidth, unsigned int DeviceHeight, BitmapFormat DeviceFormat,
282
282
    Display *display,
283
283
    Window window,
284
284
    bool has_glx_13_support,
288
288
    int req_opengl_minor,
289
289
    bool opengl_es_20)
290
290
#else
291
 
  GpuDevice::GpuDevice(t_u32 DeviceWidth, t_u32 DeviceHeight, BitmapFormat DeviceFormat,
 
291
  GpuDevice::GpuDevice(unsigned int DeviceWidth, unsigned int DeviceHeight, BitmapFormat DeviceFormat,
292
292
    Display *display,
293
293
    Window window,
294
294
    bool has_glx_13_support,
732
732
 
733
733
  int GpuDevice::AllocateUnpackPixelBufferIndex(int *index)
734
734
  {
735
 
    t_u32 num = (t_u32) _PixelBufferArray.size();
 
735
    unsigned int num = (unsigned int) _PixelBufferArray.size();
736
736
 
737
 
    for (t_u32 i = 0; i < num; i++)
 
737
    for (unsigned int i = 0; i < num; i++)
738
738
    {
739
739
      if (_PixelBufferArray[i].IsReserved == FALSE)
740
740
      {
755
755
 
756
756
  int GpuDevice::FreeUnpackPixelBufferIndex(const int index)
757
757
  {
758
 
    t_s32 num = (t_s32) _PixelBufferArray.size();
 
758
    int num = (int) _PixelBufferArray.size();
759
759
    nuxAssertMsg((index >= 0) && (index < num), "[GpuDevice::FreeUnpackPixelBufferIndex] Trying to Free a pixel buffer index that does not exist.");
760
760
 
761
761
    if ((index < 0) || (index >= num))
822
822
 
823
823
  int GpuDevice::BindUnpackPixelBufferIndex(const int index)
824
824
  {
825
 
    t_s32 num = (t_s32) _PixelBufferArray.size();
 
825
    int num = (int) _PixelBufferArray.size();
826
826
    nuxAssertMsg((index >= 0) && (index < num), "[GpuDevice::BindUnpackPixelBufferIndex] Trying to bind an invalid pixel buffer index.");
827
827
 
828
828
    if ((index < 0) || (index >= num))
843
843
 
844
844
  int GpuDevice::BindPackPixelBufferIndex(const int index)
845
845
  {
846
 
    t_s32 num = (t_s32) _PixelBufferArray.size();
 
846
    int num = (int) _PixelBufferArray.size();
847
847
    nuxAssertMsg((index >= 0) && (index < num), "[GpuDevice::BindPackPixelBufferIndex] Trying to bind an invalid pixel buffer index.");
848
848
 
849
849
    if ((index < 0) || (index >= num))
862
862
    return OGL_OK;
863
863
  }
864
864
 
865
 
  int GpuDevice::FormatFrameBufferObject(t_u32 Width, t_u32 Height, BitmapFormat PixelFormat)
 
865
  int GpuDevice::FormatFrameBufferObject(unsigned int Width, unsigned int Height, BitmapFormat PixelFormat)
866
866
  {
867
867
    if (!GetGpuInfo().Support_EXT_Framebuffer_Object())
868
868
    {
873
873
    return _FrameBufferObject->FormatFrameBufferObject(Width, Height, PixelFormat);
874
874
  }
875
875
 
876
 
  int GpuDevice::SetColorRenderTargetSurface(t_u32 ColorAttachmentIndex, ObjectPtr<IOpenGLSurface> pRenderTargetSurface)
 
876
  int GpuDevice::SetColorRenderTargetSurface(unsigned int ColorAttachmentIndex, ObjectPtr<IOpenGLSurface> pRenderTargetSurface)
877
877
  {
878
878
    if (!GetGpuInfo().Support_EXT_Framebuffer_Object())
879
879
    {
895
895
    return _FrameBufferObject->SetDepthSurface(pDepthSurface);
896
896
  }
897
897
 
898
 
  ObjectPtr<IOpenGLSurface> GpuDevice::GetColorRenderTargetSurface(t_u32 ColorAttachmentIndex)
 
898
  ObjectPtr<IOpenGLSurface> GpuDevice::GetColorRenderTargetSurface(unsigned int ColorAttachmentIndex)
899
899
  {
900
900
    if (!GetGpuInfo().Support_EXT_Framebuffer_Object())
901
901
    {