Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
da948c82
Commit
da948c82
authored
Aug 03, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5106 from vladimir-dudnik:opencl-opengl-upd
parents
0f8c46f3
5c4c8bce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
opengl_interop.cpp
samples/opengl/opengl_interop.cpp
+0
-0
winapp.hpp
samples/opengl/winapp.hpp
+50
-1
No files found.
samples/opengl/opengl_interop.cpp
View file @
da948c82
This diff is collapsed.
Click to expand it.
samples/opengl/winapp.hpp
View file @
da948c82
...
...
@@ -22,6 +22,54 @@
#define SAFE_RELEASE(p) if (p) { p->Release(); p = NULL; }
class
Timer
{
public
:
enum
UNITS
{
USEC
=
0
,
MSEC
,
SEC
};
Timer
()
:
m_t0
(
0
),
m_diff
(
0
)
{
m_tick_frequency
=
(
float
)
cv
::
getTickFrequency
();
m_unit_mul
[
USEC
]
=
1000000
;
m_unit_mul
[
MSEC
]
=
1000
;
m_unit_mul
[
SEC
]
=
1
;
}
void
clear
()
{
m_t0
=
m_diff
=
0
;
}
void
start
()
{
m_t0
=
cv
::
getTickCount
();
}
void
stop
()
{
m_diff
=
cv
::
getTickCount
()
-
m_t0
;
}
float
time
(
UNITS
u
=
UNITS
::
MSEC
)
{
float
sec
=
m_diff
/
m_tick_frequency
;
return
sec
*
m_unit_mul
[
u
];
}
public
:
float
m_tick_frequency
;
int64
m_t0
;
int64
m_diff
;
int
m_unit_mul
[
3
];
};
class
WinApp
{
public
:
...
...
@@ -162,9 +210,9 @@ public:
idle
();
}
}
while
(
!
m_end_loop
);
#endif
return
0
;
#endif
}
protected
:
...
...
@@ -218,4 +266,5 @@ protected:
int
m_width
;
int
m_height
;
std
::
string
m_window_name
;
Timer
m_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