Skip to content

Commit

Permalink
fix(Informations): Add GPU name
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Mar 13, 2018
1 parent bab3d59 commit 3fd8456
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
7 changes: 7 additions & 0 deletions Sources/controls/Informations/Informations.mcss
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@
justify-content: space-around;
padding: 10px 5px 20px 5px;
}

.textContent {
position: relative;
top: -5px;
padding: 10px 0;
text-align: center;
}
35 changes: 29 additions & 6 deletions Sources/controls/Informations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,38 @@ import style from './Informations.mcss';
const hasVR = !!navigator.getVRDisplays;

export default function Informations(props) {
const output = [
<label className={style.title} key="title-perf">
Performance monitor
</label>,
<FPSMonitor key="fps" proxyManager={props.proxyManager} />,
];
const output = [<br key="space-head" />];
const source = props.proxyManager.getActiveSource();
const view = props.proxyManager.getActiveView();
const dataset = source ? source.getDataset() : null;

// GPU data
if (view) {
const rw = view.getOpenglRenderWindow();
const allInfo = rw.getGLInformations();
const { UNMASKED_RENDERER, UNMASKED_VENDOR, WEBGL_VERSION } = allInfo;

output.push(
<label className={style.title} key="gpu">
{UNMASKED_VENDOR.value}
</label>
);
output.push(
<div className={style.textContent}>
{UNMASKED_RENDERER.value}
<br />WebGL {WEBGL_VERSION.value}
</div>
);
}

// Perf monitor
output.push(
<label className={style.title} key="title-perf">
Performance monitor
</label>
);
output.push(<FPSMonitor key="fps" proxyManager={props.proxyManager} />);

if (hasVR) {
output.push(
<label className={style.title} key="title-vr">
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"rc-dropdown": "^2.1.0",
"rc-progress": "^2.2.5",
"shelljs": "0.7.8",
"vtk.js": "6.3.11"
"vtk.js": "6.3.14"
},
"devDependencies": {
"@fortawesome/fontawesome-free-webfonts": "^1.0.4",
Expand Down

0 comments on commit 3fd8456

Please sign in to comment.