Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a5346d7f
Kaydet (Commit)
a5346d7f
authored
Agu 31, 2014
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
switch to a NSOpenGLView implementation
Change-Id: Ifed59a9e899abc900ddf27378eec6b641be061d3
üst
45f9f5f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
30 deletions
+86
-30
Library_vclopengl.mk
vcl/Library_vclopengl.mk
+20
-0
OpenGLWrapper.hxx
vcl/inc/OpenGLWrapper.hxx
+30
-0
OpenGLWrapper.cxx
vcl/osx/OpenGLWrapper.cxx
+31
-0
OpenGLContext.cxx
vcl/source/opengl/OpenGLContext.cxx
+5
-30
No files found.
vcl/Library_vclopengl.mk
Dosyayı görüntüle @
a5346d7f
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
$(eval $(call gb_Library_Library,vclopengl))
$(eval $(call gb_Library_Library,vclopengl))
$(eval $(call gb_Library_set_include,vclopengl,\
$(eval $(call gb_Library_set_include,vclopengl,\
-I$(SRCDIR)/vcl/inc/ \
$$(INCLUDE) \
$$(INCLUDE) \
))
))
...
@@ -37,12 +38,28 @@ $(eval $(call gb_Library_use_libraries,vclopengl,\
...
@@ -37,12 +38,28 @@ $(eval $(call gb_Library_use_libraries,vclopengl,\
$(gb_UWINAPI) \
$(gb_UWINAPI) \
))
))
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_cxxflags,vclopengl,\
$(gb_OBJCXXFLAGS) \
))
$(eval $(call gb_Library_add_libs,vcl,\
-framework IOKit \
-F/System/Library/PrivateFrameworks \
-framework CoreUI \
-lobjc \
))
$(eval $(call gb_Library_add_exception_objects,vclopengl,\
$(eval $(call gb_Library_add_exception_objects,vclopengl,\
vcl/osx/OpenGLWrapper \
vcl/source/opengl/OpenGLContext \
vcl/source/opengl/OpenGLContext \
vcl/source/opengl/OpenGLHelper \
vcl/source/opengl/OpenGLHelper \
vcl/source/window/openglwin \
vcl/source/window/openglwin \
))
))
endif
ifeq ($(strip $(OS)),WNT)
ifeq ($(strip $(OS)),WNT)
$(eval $(call gb_Library_use_system_win32_libs,vclopengl,\
$(eval $(call gb_Library_use_system_win32_libs,vclopengl,\
opengl32 \
opengl32 \
...
@@ -52,6 +69,9 @@ $(eval $(call gb_Library_use_system_win32_libs,vclopengl,\
...
@@ -52,6 +69,9 @@ $(eval $(call gb_Library_use_system_win32_libs,vclopengl,\
else ifeq ($(OS),MACOSX)
else ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_use_system_darwin_frameworks,vclopengl,\
$(eval $(call gb_Library_use_system_darwin_frameworks,vclopengl,\
OpenGL \
OpenGL \
Cocoa \
Carbon \
CoreFoundation \
))
))
else ifeq ($(OS),LINUX)
else ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclopengl,\
$(eval $(call gb_Library_add_libs,vclopengl,\
...
...
vcl/inc/OpenGLWrapper.hxx
0 → 100644
Dosyayı görüntüle @
a5346d7f
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "AppKit/NSOpenGLView.h"
#include "AppKit/NSOpenGL.h"
class
OpenGLWrapper
{
private
:
OpenGLWrapper
();
OpenGLWrapper
(
const
OpenGLWrapper
&
);
OpenGLWrapper
&
operator
=
(
const
OpenGLWrapper
&
);
public
:
static
void
swapBuffers
(
NSOpenGLView
*
pView
);
static
void
makeCurrent
(
NSOpenGLView
*
pView
);
static
void
resetCurrent
();
static
void
init
(
NSOpenGLView
*
pView
);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/osx/OpenGLWrapper.cxx
0 → 100644
Dosyayı görüntüle @
a5346d7f
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "OpenGLWrapper.hxx"
void
OpenGLWrapper
::
swapBuffers
(
NSOpenGLView
*
pView
)
{
[[
pView
openGLContext
]
flushBuffer
];
}
void
OpenGLWrapper
::
makeCurrent
(
NSOpenGLView
*
pView
)
{
[[
pView
openGLContext
]
makeCurrentContext
];
}
void
OpenGLWrapper
::
resetCurrent
()
{
[
NSOpenGLContext
clearCurrentContext
];
}
void
OpenGLWrapper
::
init
(
NSOpenGLView
*
pView
)
{
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/opengl/OpenGLContext.cxx
Dosyayı görüntüle @
a5346d7f
...
@@ -17,6 +17,10 @@
...
@@ -17,6 +17,10 @@
#include <vcl/bmpacc.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/graph.hxx>
#include <vcl/graph.hxx>
#include <premac.h>
#include "OpenGLWrapper.hxx"
#include <postmac.h>
using
namespace
com
::
sun
::
star
;
using
namespace
com
::
sun
::
star
;
GLWindow
::~
GLWindow
()
GLWindow
::~
GLWindow
()
...
@@ -44,8 +48,7 @@ OpenGLContext::~OpenGLContext()
...
@@ -44,8 +48,7 @@ OpenGLContext::~OpenGLContext()
ReleaseDC
(
m_aGLWin
.
hWnd
,
m_aGLWin
.
hDC
);
ReleaseDC
(
m_aGLWin
.
hWnd
,
m_aGLWin
.
hDC
);
}
}
#elif defined( MACOSX )
#elif defined( MACOSX )
CGLSetCurrentContext
(
NULL
);
OpenGLWrapper
::
resetCurrent
();
CGLDestroyContext
(
m_aGLWin
.
context
);
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID )
// nothing
// nothing
#elif defined( UNX )
#elif defined( UNX )
...
@@ -485,29 +488,6 @@ bool OpenGLContext::ImplInit()
...
@@ -485,29 +488,6 @@ bool OpenGLContext::ImplInit()
#elif defined( MACOSX )
#elif defined( MACOSX )
CGLPixelFormatAttribute
pixelFormatAttributes
[]
=
{
#if MACOSX_SDK_VERSION > 1060
kCGLPFAOpenGLProfile
,
(
CGLPixelFormatAttribute
)
kCGLOGLPVersion_3_2_Core
,
#endif
kCGLPFAColorSize
,
(
CGLPixelFormatAttribute
)
24
,
kCGLPFAAlphaSize
,
(
CGLPixelFormatAttribute
)
8
,
kCGLPFADoubleBuffer
,
kCGLPFASampleBuffers
,
(
CGLPixelFormatAttribute
)
1
,
kCGLPFASampleBuffers
,
(
CGLPixelFormatAttribute
)
4
,
(
CGLPixelFormatAttribute
)
0
};
if
(
mbRequestLegacyContext
)
pixelFormatAttributes
[
1
]
=
(
CGLPixelFormatAttribute
)
kCGLOGLPVersion_Legacy
;
CGLPixelFormatObj
pixelFormat
;
GLint
numberOfPixels
;
CGLChoosePixelFormat
(
pixelFormatAttributes
,
&
pixelFormat
,
&
numberOfPixels
);
CGLCreateContext
(
pixelFormat
,
0
,
&
m_aGLWin
.
context
);
CGLDestroyPixelFormat
(
pixelFormat
);
CGLSetCurrentContext
(
m_aGLWin
.
context
);
#elif defined( IOS )
#elif defined( IOS )
...
@@ -854,8 +834,6 @@ void OpenGLContext::makeCurrent()
...
@@ -854,8 +834,6 @@ void OpenGLContext::makeCurrent()
SAL_WARN
(
"vcl.opengl"
,
"OpenGLContext::makeCurrent(): wglMakeCurrent failed: "
<<
GetLastError
());
SAL_WARN
(
"vcl.opengl"
,
"OpenGLContext::makeCurrent(): wglMakeCurrent failed: "
<<
GetLastError
());
}
}
#elif defined( MACOSX )
#elif defined( MACOSX )
CGLError
nError
=
CGLSetCurrentContext
(
m_aGLWin
.
context
);
SAL_WARN_IF
(
nError
!=
kCGLNoError
,
"vcl.opengl"
,
"error in makeCurrent"
);
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID )
// nothing
// nothing
#elif defined( UNX )
#elif defined( UNX )
...
@@ -868,8 +846,6 @@ void OpenGLContext::resetCurrent()
...
@@ -868,8 +846,6 @@ void OpenGLContext::resetCurrent()
#if defined( WNT )
#if defined( WNT )
wglMakeCurrent
(
m_aGLWin
.
hDC
,
0
);
wglMakeCurrent
(
m_aGLWin
.
hDC
,
0
);
#elif defined( MACOSX )
#elif defined( MACOSX )
CGLError
nError
=
CGLSetCurrentContext
(
NULL
);
SAL_WARN_IF
(
nError
!=
kCGLNoError
,
"vcl.opengl"
,
"error in makeCurrent"
);
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID )
// nothing
// nothing
#elif defined( UNX )
#elif defined( UNX )
...
@@ -882,7 +858,6 @@ void OpenGLContext::swapBuffers()
...
@@ -882,7 +858,6 @@ void OpenGLContext::swapBuffers()
#if defined( WNT )
#if defined( WNT )
SwapBuffers
(
m_aGLWin
.
hDC
);
SwapBuffers
(
m_aGLWin
.
hDC
);
#elif defined( MACOSX )
#elif defined( MACOSX )
CGLFlushDrawable
(
m_aGLWin
.
context
);
#elif defined( IOS ) || defined( ANDROID )
#elif defined( IOS ) || defined( ANDROID )
// nothing
// nothing
#elif defined( UNX )
#elif defined( UNX )
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment