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
a47351f8
Kaydet (Commit)
a47351f8
authored
Şub 03, 2014
tarafından
Peilin
Kaydeden (comit)
Markus Mohrhard
Şub 03, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
replace malloc with std::vector
Change-Id: I3546d0d005d17286107ff2c70a29a4bceebd36a0
üst
89c6efe4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
OpenGLRender.cxx
chart2/source/view/main/OpenGLRender.cxx
+10
-10
OpenGLRender.hxx
chart2/source/view/main/OpenGLRender.hxx
+1
-5
No files found.
chart2/source/view/main/OpenGLRender.cxx
Dosyayı görüntüle @
a47351f8
...
...
@@ -1074,18 +1074,18 @@ int OpenGLRender::CreateMultiSampleFrameBufObj()
int
OpenGLRender
::
Create2DCircle
(
int
detail
)
{
float
angle
;
int
idx
=
2
;
if
(
detail
<=
0
)
{
return
-
1
;
}
m_Bubble2DCircle
.
bufLen
=
2
*
(
detail
+
3
)
*
sizeof
(
float
);
m_Bubble2DCircle
.
pointBuf
=
(
float
*
)
malloc
(
m_Bubble2DCircle
.
bufLen
);
memset
(
m_Bubble2DCircle
.
pointBuf
,
0
,
m_Bubble2DCircle
.
bufLen
);
m_Bubble2DCircle
.
clear
();
m_Bubble2DCircle
.
reserve
(
2
*
(
detail
+
3
));
m_Bubble2DCircle
.
push_back
(
0
);
m_Bubble2DCircle
.
push_back
(
0
);
for
(
angle
=
2.0
f
*
GL_PI
;
angle
>
-
(
2.0
f
*
GL_PI
/
detail
);
angle
-=
(
2.0
f
*
GL_PI
/
detail
))
{
m_Bubble2DCircle
.
p
ointBuf
[
idx
++
]
=
sin
(
angle
);
m_Bubble2DCircle
.
p
ointBuf
[
idx
++
]
=
cos
(
angle
);
m_Bubble2DCircle
.
p
ush_back
(
sin
(
angle
)
);
m_Bubble2DCircle
.
p
ush_back
(
cos
(
angle
)
);
}
return
0
;
}
...
...
@@ -1093,7 +1093,7 @@ int OpenGLRender::Create2DCircle(int detail)
int
OpenGLRender
::
Bubble2DShapePoint
(
float
x
,
float
y
,
float
directionX
,
float
directionY
)
{
//check whether to create the circle data
if
(
!
m_Bubble2DCircle
.
pointBuf
)
if
(
m_Bubble2DCircle
.
empty
()
)
{
Create2DCircle
(
100
);
}
...
...
@@ -1126,11 +1126,11 @@ int OpenGLRender::RenderBubble2FBO(int)
//render to fbo
//fill vertex buffer
glBindBuffer
(
GL_ARRAY_BUFFER
,
m_VertexBuffer
);
if
(
!
m_Bubble2DCircle
.
pointBuf
)
if
(
m_Bubble2DCircle
.
empty
()
)
{
Create2DCircle
(
100
);
}
glBufferData
(
GL_ARRAY_BUFFER
,
m_Bubble2DCircle
.
bufLen
,
m_Bubble2DCircle
.
pointBuf
,
GL_STATIC_DRAW
);
glBufferData
(
GL_ARRAY_BUFFER
,
m_Bubble2DCircle
.
size
()
*
sizeof
(
GLfloat
),
&
m_Bubble2DCircle
[
0
]
,
GL_STATIC_DRAW
);
glUseProgram
(
m_CommonProID
);
...
...
@@ -1148,7 +1148,7 @@ int OpenGLRender::RenderBubble2FBO(int)
0
,
// stride
(
void
*
)
0
// array buffer offset
);
glDrawArrays
(
GL_TRIANGLE_FAN
,
0
,
m_Bubble2DCircle
.
bufLen
/
sizeof
(
float
)
/
2
);
glDrawArrays
(
GL_TRIANGLE_FAN
,
0
,
m_Bubble2DCircle
.
size
(
)
/
2
);
glDisableVertexAttribArray
(
m_2DVertexID
);
glUseProgram
(
0
);
m_Bubble2DShapePointList
.
pop_front
();
...
...
chart2/source/view/main/OpenGLRender.hxx
Dosyayı görüntüle @
a47351f8
...
...
@@ -75,11 +75,7 @@ typedef struct Bubble2DPointList
float
yScale
;
}
Bubble2DPointList
;
typedef
struct
Bubble2DCircle
{
float
*
pointBuf
;
int
bufLen
;
}
Bubble2DCircle
;
typedef
std
::
vector
<
GLfloat
>
Bubble2DCircle
;
struct
RectanglePointList
{
...
...
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