Template:Require: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
m Complex condition.
Undo revision 11630 by Alfonse (talk) Wrong page.
 
(10 intermediate revisions by the same user not shown)
Line 4: Line 4:
# The extension name. If it's blank, the phrase <nowiki>"or <Extension>"</nowiki> won't be part of the text.
# The extension name. If it's blank, the phrase <nowiki>"or <Extension>"</nowiki> won't be part of the text.
# The prefix of the extension, as for [[Template:Extref]]. ARB extensions don't need one.
# The prefix of the extension, as for [[Template:Extref]]. ARB extensions don't need one.
Examples:
{|
|Just OpenGL version
|{{code|<nowiki>{{require|4.1}}</nowiki>}}
|{{require|4.1}}
|-
|Just extension
|{{code|<nowiki>{{require||separate_shader_objects}}</nowiki>}}
|{{require||separate_shader_objects}}
|-
|Both
|{{code|<nowiki>{{require|4.1|separate_shader_objects}}</nowiki>}}
|{{require|4.1|separate_shader_objects}}
|}


[[Category:Inline Formatting Templates]]
[[Category:Inline Formatting Templates]]
</noinclude><includeonly>{{#if: {{{2}}} |{{extref|{{{2|}}}}}| node |}} <!--{{#if:{{{1|}}} | OpenGL {{{1}}} | }}{{#if:{{{1|}}} |{{#if:{{{2|}}} | or | }} | }}{{#if:{{{2|}}} | {{#if: {{{3|}}} |{{extref|{{{2}}}|{{{3|}}} }}|{{extref|{{{2}}} }} }} | }}--><includeonly>
</noinclude><includeonly>{{#if:{{{1|}}} | OpenGL {{{1}}} | }}{{#if:{{{1|}}} |{{#if:{{{2|}}} | <span> or </span> | }} | }}{{#if: {{{2|}}} |{{extref|{{{2|}}}|{{{3|ARB}}}}}| |}}<includeonly>

Latest revision as of 16:58, 12 December 2014

This template is used for inline citations of required OpenGL version numbers and/or extensions. It creates a phrase of the form "OpenGL <Version> or <Extension>". It takes 3 positional parameters:

  1. The OpenGL version number. If it's blank, the phrase "OpenGL <Version> or" won't be part of the text.
  2. The extension name. If it's blank, the phrase "or <Extension>" won't be part of the text.
  3. The prefix of the extension, as for Template:Extref. ARB extensions don't need one.

Examples:

Just OpenGL version {{require|4.1}} OpenGL 4.1
Just extension {{require||separate_shader_objects}} ARB_separate_shader_objects
Both {{require|4.1|separate_shader_objects}} OpenGL 4.1 or ARB_separate_shader_objects