Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Luis Penaranda
panoramic
Commits
cf654b44
Commit
cf654b44
authored
Jan 08, 2013
by
Luis Penaranda
Browse files
removed some gcc warnings
parent
2d6af942
Changes
1
Hide whitespace changes
Inline
Side-by-side
openglcanvas.cpp
View file @
cf654b44
...
...
@@ -136,7 +136,10 @@ void OpenGLCanvas::initializeGL(){
glHint
(
GL_PERSPECTIVE_CORRECTION_HINT
,
GL_NICEST
);
char
*
input_image
=
(
char
*
)
malloc
(
512
*
sizeof
(
char
*
));
GET_WORKDIR
(
input_image
,
512
);
if
(
!
GET_WORKDIR
(
input_image
,
512
)){
fprintf
(
stderr
,
"too long pathname
\n
"
);
exit
(
-
1
);
};
strcat
(
input_image
,
"/
\0
"
);
strcat
(
input_image
,
INPUT_IMAGE_FILE
);
#ifdef __APPLE__
...
...
@@ -497,13 +500,19 @@ void OpenGLCanvas::setShaders() {
GLuint
f
=
glCreateShader
(
GL_FRAGMENT_SHADER
);
char
*
vs_file
=
(
char
*
)
malloc
(
512
*
sizeof
(
char
*
));
GET_WORKDIR
(
vs_file
,
512
);
if
(
!
GET_WORKDIR
(
vs_file
,
512
)){
fprintf
(
stderr
,
"too long pathname
\n
"
);
exit
(
-
1
);
};
strcat
(
vs_file
,
"/
\0
"
);
strcat
(
vs_file
,
VERT_SHADER_FILE
);
fprintf
(
stderr
,
"vs_file=%s
\n
"
,
vs_file
);
char
*
fs_file
=
(
char
*
)
malloc
(
512
*
sizeof
(
char
*
));
GET_WORKDIR
(
fs_file
,
512
);
if
(
!
GET_WORKDIR
(
fs_file
,
512
)){
fprintf
(
stderr
,
"too long pathname
\n
"
);
exit
(
-
1
);
};
strcat
(
fs_file
,
"/
\0
"
);
strcat
(
fs_file
,
FRAG_SHADER_FILE
);
fprintf
(
stderr
,
"fs_file=%s
\n
"
,
fs_file
);
...
...
@@ -558,7 +567,7 @@ void OpenGLCanvas::paintGL(){
// defining transformation parameters (that will be passed to the vertex shader)
float
extent
=
calculate_extent
(
fov_rads
);
float
vis_mode
;
float
vis_mode
=
.0
;
if
(
visualization
==
"Perspective"
)
vis_mode
=
1.0
;
else
if
(
visualization
==
"3D Sphere"
)
vis_mode
=
2.0
;
else
if
(
visualization
==
"Equi-Rectangular"
)
vis_mode
=
3.0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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