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
e03244c9
Kaydet (Commit)
e03244c9
authored
Tem 06, 2015
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix Funky Capitalisation Of Comments
Change-Id: I2846824d402d029cde8d214f8112047243c79c54
üst
b183507e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
OpenGLContext.cxx
vcl/source/opengl/OpenGLContext.cxx
+25
-25
No files found.
vcl/source/opengl/OpenGLContext.cxx
Dosyayı görüntüle @
e03244c9
...
@@ -232,33 +232,33 @@ bool WGLisExtensionSupported(const char *extension)
...
@@ -232,33 +232,33 @@ bool WGLisExtensionSupported(const char *extension)
const
size_t
extlen
=
strlen
(
extension
);
const
size_t
extlen
=
strlen
(
extension
);
const
char
*
supported
=
NULL
;
const
char
*
supported
=
NULL
;
// Try
To Use wglGetExtensionStringARB On Current DC, If P
ossible
// Try
to use wglGetExtensionStringARB on current DC, if p
ossible
PROC
wglGetExtString
=
wglGetProcAddress
(
"wglGetExtensionsStringARB"
);
PROC
wglGetExtString
=
wglGetProcAddress
(
"wglGetExtensionsStringARB"
);
if
(
wglGetExtString
)
if
(
wglGetExtString
)
supported
=
((
char
*
(
__stdcall
*
)(
HDC
))
wglGetExtString
)(
wglGetCurrentDC
());
supported
=
((
char
*
(
__stdcall
*
)(
HDC
))
wglGetExtString
)(
wglGetCurrentDC
());
// If
That Failed, Try Standard Opengl Extensions S
tring
// If
that failed, try standard OpenGL extensions s
tring
if
(
supported
==
NULL
)
if
(
supported
==
NULL
)
supported
=
(
char
*
)
glGetString
(
GL_EXTENSIONS
);
supported
=
(
char
*
)
glGetString
(
GL_EXTENSIONS
);
// If
That Failed Too, Must Be No Extensions S
upported
// If
that failed too, must be no extensions s
upported
if
(
supported
==
NULL
)
if
(
supported
==
NULL
)
return
false
;
return
false
;
// Begin
Examination At Start Of String, Increment By 1 On False M
atch
// Begin
examination at start of string, increment by 1 on false m
atch
for
(
const
char
*
p
=
supported
;
;
p
++
)
for
(
const
char
*
p
=
supported
;
;
p
++
)
{
{
// Advance p
Up To The Next Possible M
atch
// Advance p
up to the next possible m
atch
p
=
strstr
(
p
,
extension
);
p
=
strstr
(
p
,
extension
);
if
(
p
==
NULL
)
if
(
p
==
NULL
)
return
0
;
// No Match
return
0
;
// No Match
// Make
Sure That Match Is At The Start Of The String Or T
hat
// Make
sure that match is at the start of the string or t
hat
//
The Previous Char Is A Space, Or Else We Could A
ccidentally
//
the previous char is a space, or else we could a
ccidentally
//
Match "wglFunkywglExtension" W
ith "wglExtension"
//
match "wglFunkywglExtension" w
ith "wglExtension"
// Also,
Make Sure That The Following Character Is Space Or NULL
// Also,
make sure that the following character is space or null
//
Or Else "wglExtensionTwo" Might M
atch "wglExtension"
//
or else "wglExtensionTwo" might m
atch "wglExtension"
if
((
p
==
supported
||
p
[
-
1
]
==
' '
)
&&
(
p
[
extlen
]
==
'\0'
||
p
[
extlen
]
==
' '
))
if
((
p
==
supported
||
p
[
-
1
]
==
' '
)
&&
(
p
[
extlen
]
==
'\0'
||
p
[
extlen
]
==
' '
))
return
1
;
// Match
return
1
;
// Match
}
}
...
@@ -269,37 +269,37 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
...
@@ -269,37 +269,37 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
{
{
HWND
hWnd
=
NULL
;
HWND
hWnd
=
NULL
;
GLWindow
glWin
;
GLWindow
glWin
;
//
c
reate a temp window to check whether support multi-sample, if support, get the format
//
C
reate a temp window to check whether support multi-sample, if support, get the format
if
(
InitTempWindow
(
&
hWnd
,
1
,
1
,
pfd
,
glWin
)
<
0
)
if
(
InitTempWindow
(
&
hWnd
,
1
,
1
,
pfd
,
glWin
)
<
0
)
{
{
SAL_WARN
(
"vcl.opengl"
,
"Can't create temp window to test"
);
SAL_WARN
(
"vcl.opengl"
,
"Can't create temp window to test"
);
return
false
;
return
false
;
}
}
// See
If The String Exists In WGL!
// See
if the string exists in WGL
if
(
!
WGLisExtensionSupported
(
"WGL_ARB_multisample"
))
if
(
!
WGLisExtensionSupported
(
"WGL_ARB_multisample"
))
{
{
SAL_WARN
(
"vcl.opengl"
,
"Device doesn't support multi
sample"
);
SAL_WARN
(
"vcl.opengl"
,
"Device doesn't support multisample"
);
return
false
;
return
false
;
}
}
// Get
Our Pixel F
ormat
// Get
our pixel f
ormat
PFNWGLCHOOSEPIXELFORMATARBPROC
wglChoosePixelFormatARB
=
(
PFNWGLCHOOSEPIXELFORMATARBPROC
)
wglGetProcAddress
(
"wglChoosePixelFormatARB"
);
PFNWGLCHOOSEPIXELFORMATARBPROC
wglChoosePixelFormatARB
=
(
PFNWGLCHOOSEPIXELFORMATARBPROC
)
wglGetProcAddress
(
"wglChoosePixelFormatARB"
);
if
(
!
wglChoosePixelFormatARB
)
if
(
!
wglChoosePixelFormatARB
)
{
{
return
false
;
return
false
;
}
}
// Get
Our Current Device C
ontext
// Get
our current device c
ontext
HDC
hDC
=
GetDC
(
hWnd
);
HDC
hDC
=
GetDC
(
hWnd
);
int
pixelFormat
;
int
pixelFormat
;
int
valid
;
int
valid
;
UINT
numFormats
;
UINT
numFormats
;
float
fAttributes
[]
=
{
0
,
0
};
float
fAttributes
[]
=
{
0
,
0
};
// These
Attributes Are The Bits We Want To Test For In Our Sample
// These
attributes are the bits we want to test for in our sample.
// Everything
Is Pretty Standard, The Only One We Want T
o
// Everything
is pretty standard, the only one we want t
o
//
Really Focus On Is The SAMPLE BUFFERS ARB And WGL SAMPLES
//
really focus on is the WGL_SAMPLE_BUFFERS_ARB and WGL_SAMPLES_ARB.
// These
Two Are Going To Do The Main Testing For Whether Or N
ot
// These
two are going to do the main testing for whether or n
ot
//
We Support Multisampling On This H
ardware.
//
we support multisampling on this h
ardware.
int
iAttributes
[]
=
int
iAttributes
[]
=
{
{
WGL_DOUBLE_BUFFER_ARB
,
GL_TRUE
,
WGL_DOUBLE_BUFFER_ARB
,
GL_TRUE
,
...
@@ -325,9 +325,9 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
...
@@ -325,9 +325,9 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
bool
bArbMultisampleSupported
=
true
;
bool
bArbMultisampleSupported
=
true
;
// First
We Check To See If We Can Get A Pixel Format For 4 S
amples
// First
we check to see if we can get a pixel format for 4 s
amples
valid
=
wglChoosePixelFormatARB
(
hDC
,
iAttributes
,
fAttributes
,
1
,
&
pixelFormat
,
&
numFormats
);
valid
=
wglChoosePixelFormatARB
(
hDC
,
iAttributes
,
fAttributes
,
1
,
&
pixelFormat
,
&
numFormats
);
// If
We Returned True, And Our Format Count Is Greater T
han 1
// If
we returned true, and our format count is greater t
han 1
if
(
valid
&&
numFormats
>=
1
)
if
(
valid
&&
numFormats
>=
1
)
{
{
bArbMultisampleSupported
=
true
;
bArbMultisampleSupported
=
true
;
...
@@ -338,7 +338,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
...
@@ -338,7 +338,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
DestroyWindow
(
hWnd
);
DestroyWindow
(
hWnd
);
return
bArbMultisampleSupported
;
return
bArbMultisampleSupported
;
}
}
// Our
Pixel Format With 4 Samples Failed, Test For 2 S
amples
// Our
pixel format with 4 samples failed, test for 2 s
amples
iAttributes
[
19
]
=
2
;
iAttributes
[
19
]
=
2
;
valid
=
wglChoosePixelFormatARB
(
hDC
,
iAttributes
,
fAttributes
,
1
,
&
pixelFormat
,
&
numFormats
);
valid
=
wglChoosePixelFormatARB
(
hDC
,
iAttributes
,
fAttributes
,
1
,
&
pixelFormat
,
&
numFormats
);
if
(
valid
&&
numFormats
>=
1
)
if
(
valid
&&
numFormats
>=
1
)
...
@@ -351,7 +351,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
...
@@ -351,7 +351,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
DestroyWindow
(
hWnd
);
DestroyWindow
(
hWnd
);
return
bArbMultisampleSupported
;
return
bArbMultisampleSupported
;
}
}
// Return
The Valid F
ormat
// Return
the valid f
ormat
wglMakeCurrent
(
NULL
,
NULL
);
wglMakeCurrent
(
NULL
,
NULL
);
wglDeleteContext
(
glWin
.
hRC
);
wglDeleteContext
(
glWin
.
hRC
);
ReleaseDC
(
hWnd
,
glWin
.
hDC
);
ReleaseDC
(
hWnd
,
glWin
.
hDC
);
...
@@ -1187,7 +1187,7 @@ void OpenGLContext::initGLWindow(Visual* pVisual)
...
@@ -1187,7 +1187,7 @@ void OpenGLContext::initGLWindow(Visual* pVisual)
m_aGLWin
.
vi
=
pInfos
;
m_aGLWin
.
vi
=
pInfos
;
}
}
// Check multi
sample support
// Check multisample support
/* TODO: moggi: This is not necessarily correct in the DBG_UTIL path, as it picks
/* TODO: moggi: This is not necessarily correct in the DBG_UTIL path, as it picks
* an FBConfig instead ... */
* an FBConfig instead ... */
int
nSamples
=
0
;
int
nSamples
=
0
;
...
...
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