Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
panoramic
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Luis Penaranda
panoramic
Commits
fca0faf5
Commit
fca0faf5
authored
Jan 09, 2013
by
Luis Peñaranda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep aspect ratio while resizing the window
parent
9fe614ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
openglcanvas.cpp
openglcanvas.cpp
+5
-5
openglcanvas.h
openglcanvas.h
+2
-3
No files found.
openglcanvas.cpp
View file @
fca0faf5
...
...
@@ -157,11 +157,11 @@ void OpenGLCanvas::initializeGL(){
struct
stat
testbuf
;
if
(
stat
(
input_image
,
&
testbuf
)){
fprintf
(
stderr
,
"the default image file does not exist!
\n
"
);
free
(
input_image
);
load_image
(
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Choose Panorama File"
)).
toStdString
().
c_str
());
}
else
{
load_image
(
input_image
);
}
free
(
input_image
);
// mesh resolution
int
m
,
n
;
...
...
@@ -196,9 +196,7 @@ void OpenGLCanvas::initializeGL(){
numberOfIndices
=
meshNumIndices
;
triangleIndices
=
indices
;
free
(
input_image
);
setShaders
();
}
void
OpenGLCanvas
::
define_texture_coordinates
(
float
*
texCoord
,
int
m
,
int
n
,
float
min_phi
,
float
max_phi
,
float
min_lambda
,
float
max_lambda
){
...
...
@@ -458,8 +456,10 @@ void OpenGLCanvas::readTextureBytes(const char * const progname,
}
void
OpenGLCanvas
::
resizeGL
(
int
w
,
int
h
){
glViewport
(
0
,
0
,
w
,
h
);
if
(
w
>
h
)
glViewport
(
0
,(
h
-
w
)
/
2
,
w
,
w
);
else
glViewport
((
w
-
h
)
/
2
,
0
,
h
,
h
);
}
char
*
OpenGLCanvas
::
textFileRead
(
char
*
fn
)
{
...
...
openglcanvas.h
View file @
fca0faf5
...
...
@@ -86,9 +86,8 @@ private:
unsigned
int
*
triangleIndices
;
float
*
verticesPositions
;
float
*
textureCoordinates
;
float
windowWidth
;
float
windowHeight
;
//float windowWidth;
//float windowHeight;
};
#endif // OPENGLCANVAS_H
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