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
1554fc96
Kaydet (Commit)
1554fc96
authored
May 20, 2014
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
libgltf: Updated version.
Change-Id: Ia394ff00421f495757cc2ce55e7b91bfebe715eb
üst
f9d3abef
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
135 additions
and
43 deletions
+135
-43
oglframegrabber.cxx
avmedia/source/opengl/oglframegrabber.cxx
+2
-2
oglplayer.cxx
avmedia/source/opengl/oglplayer.cxx
+1
-2
oglwindow.cxx
avmedia/source/opengl/oglwindow.cxx
+6
-6
download.lst
download.lst
+1
-1
UnpackedTarball_libgltf.mk
external/libgltf/UnpackedTarball_libgltf.mk
+1
-1
disable_fps.patch
external/libgltf/patches/disable_fps.patch
+0
-31
disable_fps_and_timer.patch
external/libgltf/patches/disable_fps_and_timer.patch
+124
-0
No files found.
avmedia/source/opengl/oglframegrabber.cxx
Dosyayı görüntüle @
1554fc96
...
@@ -33,11 +33,11 @@ OGLFrameGrabber::~OGLFrameGrabber()
...
@@ -33,11 +33,11 @@ OGLFrameGrabber::~OGLFrameGrabber()
{
{
}
}
uno
::
Reference
<
css
::
graphic
::
XGraphic
>
SAL_CALL
OGLFrameGrabber
::
grabFrame
(
double
fMediaTime
)
uno
::
Reference
<
css
::
graphic
::
XGraphic
>
SAL_CALL
OGLFrameGrabber
::
grabFrame
(
double
/*fMediaTime*/
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
{
boost
::
scoped_array
<
sal_uInt8
>
pBuffer
(
new
sal_uInt8
[
m_pHandle
->
viewport
.
width
*
m_pHandle
->
viewport
.
height
*
4
]);
boost
::
scoped_array
<
sal_uInt8
>
pBuffer
(
new
sal_uInt8
[
m_pHandle
->
viewport
.
width
*
m_pHandle
->
viewport
.
height
*
4
]);
gltf_renderer_get_bitmap
(
&
m_pHandle
,
1
,
fMediaTime
,
(
char
*
)
pBuffer
.
get
(),
GL_BGRA
);
gltf_renderer_get_bitmap
(
&
m_pHandle
,
1
,
(
char
*
)
pBuffer
.
get
(),
GL_BGRA
);
BitmapEx
aBitmap
=
OpenGLHelper
::
ConvertBGRABufferToBitmapEx
(
pBuffer
.
get
(),
m_pHandle
->
viewport
.
width
,
m_pHandle
->
viewport
.
height
);
BitmapEx
aBitmap
=
OpenGLHelper
::
ConvertBGRABufferToBitmapEx
(
pBuffer
.
get
(),
m_pHandle
->
viewport
.
width
,
m_pHandle
->
viewport
.
height
);
return
Graphic
(
aBitmap
).
GetXGraphic
();
return
Graphic
(
aBitmap
).
GetXGraphic
();
}
}
...
...
avmedia/source/opengl/oglplayer.cxx
Dosyayı görüntüle @
1554fc96
...
@@ -30,8 +30,7 @@ OGLPlayer::OGLPlayer()
...
@@ -30,8 +30,7 @@ OGLPlayer::OGLPlayer()
OGLPlayer
::~
OGLPlayer
()
OGLPlayer
::~
OGLPlayer
()
{
{
// Comment out while it causes segmentation fault
gltf_renderer_release
(
m_pHandle
);
// gltf_renderer_release(m_pHandle);
}
}
static
bool
lcl_LoadFile
(
glTFFile
*
io_pFile
,
const
OUString
&
rURL
)
static
bool
lcl_LoadFile
(
glTFFile
*
io_pFile
,
const
OUString
&
rURL
)
...
...
avmedia/source/opengl/oglwindow.cxx
Dosyayı görüntüle @
1554fc96
...
@@ -32,9 +32,9 @@ OGLWindow::~OGLWindow()
...
@@ -32,9 +32,9 @@ OGLWindow::~OGLWindow()
void
SAL_CALL
OGLWindow
::
update
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
void
SAL_CALL
OGLWindow
::
update
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
{
m_pContext
->
makeCurrent
();
m_pContext
->
makeCurrent
();
gltf_prepare_renderer
(
&
m_pHandle
->
viewport
);
gltf_prepare_renderer
(
m_pHandle
);
gltf_renderer
(
m_pHandle
);
gltf_renderer
(
m_pHandle
);
gltf_complete_renderer
();
gltf_complete_renderer
(
m_pHandle
);
m_pContext
->
swapBuffers
();
m_pContext
->
swapBuffers
();
}
}
...
@@ -257,8 +257,8 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
...
@@ -257,8 +257,8 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
glm
::
vec3
vEye
;
glm
::
vec3
vEye
;
glm
::
vec3
vView
;
glm
::
vec3
vView
;
glm
::
vec3
vUp
;
glm
::
vec3
vUp
;
gltf_get_camera_pos
(
&
vEye
,
&
vView
,
&
vUp
);
gltf_get_camera_pos
(
m_pHandle
,
&
vEye
,
&
vView
,
&
vUp
);
float
fModelSize
=
(
float
)
gltf_get_model_size
();
float
fModelSize
=
(
float
)
gltf_get_model_size
(
m_pHandle
);
glm
::
vec3
vMove
=
vView
-
vEye
;
glm
::
vec3
vMove
=
vView
-
vEye
;
vMove
=
glm
::
normalize
(
vMove
);
vMove
=
glm
::
normalize
(
vMove
);
...
@@ -277,7 +277,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
...
@@ -277,7 +277,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
if
(
nCode
==
KEY_W
)
vMoveBy
-=
vMup
*
(
0.001
f
*
fModelSize
);
if
(
nCode
==
KEY_W
)
vMoveBy
-=
vMup
*
(
0.001
f
*
fModelSize
);
if
(
nCode
==
KEY_S
)
vMoveBy
+=
vMup
*
(
0.001
f
*
fModelSize
);
if
(
nCode
==
KEY_S
)
vMoveBy
+=
vMup
*
(
0.001
f
*
fModelSize
);
}
}
gltf_renderer_move_camera
(
vMoveBy
.
x
,
vMoveBy
.
y
,
vMoveBy
.
z
,
0.0
);
gltf_renderer_move_camera
(
m_pHandle
,
vMoveBy
.
x
,
vMoveBy
.
y
,
vMoveBy
.
z
,
0.0
);
update
();
update
();
}
}
}
}
...
@@ -309,7 +309,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
...
@@ -309,7 +309,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
long
nDeltaX
=
m_aLastMousePos
.
X
()
-
aCurPos
.
X
();
long
nDeltaX
=
m_aLastMousePos
.
X
()
-
aCurPos
.
X
();
long
nDeltaY
=
aCurPos
.
Y
()
-
m_aLastMousePos
.
Y
();
long
nDeltaY
=
aCurPos
.
Y
()
-
m_aLastMousePos
.
Y
();
// TODO: It seems this method just moves the camera but not rotate it.
// TODO: It seems this method just moves the camera but not rotate it.
gltf_renderer_rotate_camera
(
(
float
)
nDeltaX
*
fSensitivity
,(
float
)
nDeltaY
*
fSensitivity
,
0.0
,
0.0
);
gltf_renderer_rotate_camera
(
m_pHandle
,
(
float
)
nDeltaX
*
fSensitivity
,
(
float
)
nDeltaY
*
fSensitivity
,
0.0
,
0.0
);
update
();
update
();
m_aLastMousePos
=
aCurPos
;
m_aLastMousePos
=
aCurPos
;
...
...
download.lst
Dosyayı görüntüle @
1554fc96
...
@@ -88,7 +88,7 @@ export LIBATOMIC_OPS_TARBALL := libatomic_ops-7_2d.zip
...
@@ -88,7 +88,7 @@ export LIBATOMIC_OPS_TARBALL := libatomic_ops-7_2d.zip
export LIBEOT_MD5SUM := aa24f5dd2a2992f4a116aa72af817548
export LIBEOT_MD5SUM := aa24f5dd2a2992f4a116aa72af817548
export LIBEOT_TARBALL := libeot-0.01.tar.bz2
export LIBEOT_TARBALL := libeot-0.01.tar.bz2
export LIBEXTTEXTCAT_TARBALL := ae330b9493bd4503ac390106ff6060d7-libexttextcat-3.4.3.tar.bz2
export LIBEXTTEXTCAT_TARBALL := ae330b9493bd4503ac390106ff6060d7-libexttextcat-3.4.3.tar.bz2
export LIBGLTF_TARBALL :=
02faa5e385c7083fc1e9cfbe71470e1f
-libgltf.tar.bz2
export LIBGLTF_TARBALL :=
510c3f8504bfb8cc8c8fc5d0fac74055
-libgltf.tar.bz2
export LIBLANGTAG_TARBALL := 36271d3fa0d9dec1632029b6d7aac925-liblangtag-0.5.1.tar.bz2
export LIBLANGTAG_TARBALL := 36271d3fa0d9dec1632029b6d7aac925-liblangtag-0.5.1.tar.bz2
export LIBXMLSEC_TARBALL := 1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
export LIBXMLSEC_TARBALL := 1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
export LIBXML_TARBALL := 9c0cfef285d5c4a5c80d00904ddab380-libxml2-2.9.1.tar.gz
export LIBXML_TARBALL := 9c0cfef285d5c4a5c80d00904ddab380-libxml2-2.9.1.tar.gz
...
...
external/libgltf/UnpackedTarball_libgltf.mk
Dosyayı görüntüle @
1554fc96
...
@@ -18,7 +18,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libgltf,1))
...
@@ -18,7 +18,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libgltf,1))
$(eval $(call gb_UnpackedTarball_add_patches,libgltf,\
$(eval $(call gb_UnpackedTarball_add_patches,libgltf,\
external/libgltf/patches/include_path_glew.patch \
external/libgltf/patches/include_path_glew.patch \
external/libgltf/patches/include_path_freetype.patch \
external/libgltf/patches/include_path_freetype.patch \
external/libgltf/patches/disable_fps.patch \
external/libgltf/patches/disable_fps
_and_timer
.patch \
))
))
# vim: set noet sw=4 ts=4:
# vim: set noet sw=4 ts=4:
external/libgltf/patches/disable_fps.patch
deleted
100644 → 0
Dosyayı görüntüle @
f9d3abef
diff --git libgltf/src/FPSCounter.h libgltf/src/FPSCounter.h
index c6c4279..66f7e2b 100644
--- libgltf/src/FPSCounter.h
+++ libgltf/src/FPSCounter.h
@@ -7,6 +7,11 @@
*/
#ifndef FPSCOUNTER_H
#define FPSCOUNTER_H
+
+#define ENABLE_FPS 0
+
+#if ENABLE_FPS
+
#include "time.h"
#include "Font.h"
#include "Shaders.h"
@@ -17,7 +22,6 @@
#define WRITEFPS2FILE 1
#define TIMETHRESHOLD 30
-#define ENABLE_FPS 1
#define FPS_FILE "./FPSCounter.txt"
#if WRITEFPS2FILE
#include <iostream>
@@ -136,4 +140,6 @@ private:
#endif
};
+#endif // ENABLE_FPS
+
#endif
external/libgltf/patches/disable_fps_and_timer.patch
0 → 100644
Dosyayı görüntüle @
1554fc96
diff --git libgltf/src/RenderScene.cpp libgltf/src/RenderScene.cpp
index 88c5c9a..6639572 100644
--- libgltf/src/RenderScene.cpp
+++ libgltf/src/RenderScene.cpp
@@ -383,7 +383,9 @@ void RenderWithFBO::releaseFbo()
CPhysicalCamera* RenderScene::sCamera = NULL;
+#if ENABLE_FPS
FPSCounter* RenderScene::pFPSCounter = NULL;
+#endif
ShaderProgram RenderScene::mShaderProgram = ShaderProgram();
RenderScene::RenderScene()
@@ -400,10 +402,12 @@ RenderScene::RenderScene()
RenderScene::~RenderScene()
{
+#if ENABLE_FPS
if (pFPSCounter != NULL)
{
delete pFPSCounter;
}
+#endif
#if ENABLE_TIMER
if(pTimer != NULL)
{
@@ -815,8 +819,10 @@ int RenderScene::initRender(glTFHandle* handle)
void RenderScene::initFPS(unsigned char* fontBuf,unsigned int bufSize)
{
+#if ENABLE_FPS
pFPSCounter = new FPSCounter(fontBuf,bufSize);
pFPSCounter->loadFPSShader(&mShaderProgram);
+#endif
}
void RenderScene::renderPrimitive(RenderPrimitive* pPrimitive,
@@ -1132,10 +1138,12 @@ void RenderScene::drawTriangle(RenderPrimitive* pPrimitive)
void RenderScene::prepareRender(void* lpParam)
{
+#if ENABLE_FPS
if (pFPSCounter != NULL)
{
pFPSCounter->timeStamp();
}
+#endif
viewport = *((glTFViewport*)lpParam);
fbo.createAndBindFbo(viewport.width * SSAA, viewport.height * SSAA);
glBindFramebuffer(GL_FRAMEBUFFER, fbo.mFboId);
@@ -1229,10 +1237,12 @@ void RenderScene::renderShader(Technique* pTechnique)
void RenderScene::completeRender()
{
+#if ENABLE_FPS
if (pFPSCounter != NULL)
{
pFPSCounter->printFPS(&viewport);
}
+#endif
glViewport(viewport.x, viewport.y, viewport.width, viewport.height);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
fbo.renderFboTexture();
@@ -1356,4 +1366,4 @@ double RenderScene::getAnimDuration()
int RenderScene::isAnimPlay()
{
return this->mAnimationPlay ? 1 : 0;
-}
\ No newline at end of file
+}
diff --git libgltf/src/RenderScene.h libgltf/src/RenderScene.h
index cc0b3e5..065a689 100644
--- libgltf/src/RenderScene.h
+++ libgltf/src/RenderScene.h
@@ -8,12 +8,22 @@
#ifndef RENDERSCENE_H
#define RENDERSCENE_H
+#ifndef ENABLE_FPS
+#define ENABLE_FPS 0
+#endif
+
+#ifndef ENABLE_TIMER
+#define ENABLE_TIMER 0
+#endif
+
#include "Shaders.h"
#include "Common.h"
#include "Texture.h"
#include "Camera.h"
#include "LoadScene.h"
+#if ENABLE_FPS
#include "FPSCounter.h"
+#endif
#include "Timer.h"
using namespace glTF;
@@ -246,7 +256,9 @@ private:
bool loadFPSShader();
int getFPS();
void printFPS(glTFViewport* pViewpoit);
+#if ENABLE_FPS
static FPSCounter* pFPSCounter;
+#endif
RenderWithFBO fbo;
#if ENABLE_TIMER
Timer* pTimer;
diff --git libgltf/src/Timer.h libgltf/src/Timer.h
index e4d778b..9ab2d74 100644
--- libgltf/src/Timer.h
+++ libgltf/src/Timer.h
@@ -10,7 +10,10 @@
#include "time.h"
#include "Common.h"
-#define ENABLE_TIMER 1
+#ifndef ENABLE_TIMER
+#define ENABLE_TIMER 0
+#endif
+
#define DETAILED_INFO 1
#if ENABLE_TIMER
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