Skip to content

Commit ba3c786

Browse files
committed
implement IntelliSense hints for MSVC
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
1 parent 985d652 commit ba3c786

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

glad/generator/c/templates/base_template.h

+8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ extern "C" {
6666
{% block commands %}
6767
{{ template_utils.write_function_typedefs(feature_set.commands) }}
6868
{% if not options.mx %}
69+
#ifdef __INTELLISENSE__
70+
{{ template_utils.write_function_definitions(feature_set.commands) }}
71+
#else
6972
{{ template_utils.write_function_declarations(feature_set.commands, debug=options.debug) }}
73+
#endif
7074
{% else %}
7175
typedef struct Glad{{ feature_set.name|api }}Context {
7276
void* userptr;
@@ -93,9 +97,13 @@ GLAD_API_CALL Glad{{ feature_set.name|api }}Context* glad_{{ feature_set.name }}
9397
#define GLAD_{{ extension.name }} (glad_{{ feature_set.name }}_context->{{ extension.name|no_prefix }})
9498
{% endfor %}
9599

100+
#ifdef __INTELLISENSE__
101+
{{ template_utils.write_function_definitions(feature_set.commands) }}
102+
#else
96103
{% for command in feature_set.commands %}
97104
#define {{ command.name }} (glad_{{ feature_set.name }}_context->{{ command.name|no_prefix }})
98105
{% endfor %}
106+
#endif
99107
{% endif %}
100108

101109
{% endif %}

glad/generator/c/templates/wgl.h

+4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
{{ template_utils.write_function_typedefs(feature_set.commands) }}
1111
{# these are already defined in windows.h #}
1212
{% set blacklist = feature_set.features[0].get_requirements(spec, feature_set=feature_set).commands %}
13+
#ifdef __INTELLISENSE__
14+
{{ template_utils.write_function_definitions(feature_set.commands|reject('existsin', blacklist)) }}
15+
#else
1316
{{ template_utils.write_function_declarations(feature_set.commands|reject('existsin', blacklist)) }}
17+
#endif
1418
{% endblock %}
1519

1620

0 commit comments

Comments
 (0)