Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
libshadertoy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HUYNH Danh
libshadertoy
Commits
fd576619
Commit
fd576619
authored
7 years ago
by
TAVERNIER Vincent
Browse files
Options
Downloads
Patches
Plain Diff
Fix example code
parent
d7e1d92a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/50-shadertoy/main.cpp
+6
-5
6 additions, 5 deletions
examples/50-shadertoy/main.cpp
with
6 additions
and
5 deletions
examples/50-shadertoy/main.cpp
+
6
−
5
View file @
fd576619
...
...
@@ -94,13 +94,14 @@ Json::Value json_get(CURL *curl, const string &url)
return
result
;
}
int
parseOptions
(
string
&
shaderId
,
string
&
shaderApiKey
,
bool
dump
,
int
argc
,
char
*
argv
[])
int
parseOptions
(
string
&
shaderId
,
string
&
shaderApiKey
,
bool
&
dump
,
int
argc
,
char
*
argv
[])
{
// Read and parse options
bool
help
;
po
::
options_description
desc
(
"libshadertoy 50-shadertoy example"
);
desc
.
add_options
()
(
"
h,
help"
,
po
::
bool_switch
(
&
dum
p
)
->
default_value
(
false
),
"show a help message"
)
(
"dump,d"
,
"Dump binary formats of the loaded programs"
)
(
"help
,h
"
,
po
::
bool_switch
(
&
hel
p
)
->
default_value
(
false
),
"show a help message"
)
(
"dump,d"
,
po
::
bool_switch
(
&
dump
)
->
default_value
(
false
),
"Dump binary formats of the loaded programs"
)
(
"id,i"
,
po
::
value
<
string
>
(
&
shaderId
)
->
required
(),
"ID of the ShaderToy to render"
)
(
"api,a"
,
po
::
value
<
string
>
(
&
shaderApiKey
)
->
required
(),
"API key for ShaderToy query"
);
...
...
@@ -117,7 +118,7 @@ int parseOptions(string &shaderId, string &shaderApiKey, bool dump, int argc, ch
return
2
;
}
if
(
vm
.
find
(
"help"
)
!=
vm
.
end
()
)
if
(
help
)
{
cout
<<
desc
<<
endl
;
return
1
;
...
...
@@ -461,7 +462,7 @@ int main(int argc, char *argv[])
// Options
string
shaderId
,
shaderApiKey
;
bool
dumpShaders
=
false
;
bool
dumpShaders
;
// Parse options from ARGV
code
=
parseOptions
(
shaderId
,
shaderApiKey
,
dumpShaders
,
argc
,
argv
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment