This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:tutorials:community:ludig:hexagongrid2 [2019/09/19 05:19 (5 years ago)] – ludig | en:tutorials:shaders:hexagongrid2 [2020/08/31 07:11 (4 years ago)] (current) – ↷ Links adapted because of a move operation sausage | ||
---|---|---|---|
Line 2: | Line 2: | ||
=====Introduction===== | =====Introduction===== | ||
This tutorial showcases how to draw a hexagon grid using a shader, as well as using the mouse position to highlight specific hexagon tiles.\\ \\ | This tutorial showcases how to draw a hexagon grid using a shader, as well as using the mouse position to highlight specific hexagon tiles.\\ \\ | ||
- | {{en:tutorials:community: | + | {{tutorials: |
- | It is based off of the this [[en: | + | It is based off of the this [[en: |
=====Details===== | =====Details===== | ||
The axial/ | The axial/ | ||
=====Source Code===== | =====Source Code===== | ||
- | A complete version of this tutorial' | + | A complete version of this tutorial' |
- | This repository also contains hexagon resource files that can be used as textures for your hexagon shader.\\ ***__Note:__** Pointy-top and flat-top hexagons use different texture files, so you will need to ensure that you match the right files with your hexagon layout. | + | This repository also contains hexagon resource files that can be used as textures for your hexagon shader.\\ |
- | ====INI File==== | + | **__NOTE:__** Pointy-top and flat-top hexagons use different texture files, so you will need to ensure that you match the right files with your hexagon layout. |
+ | ====INI File (tut_hex.ini)==== | ||
+ | **ORX Config File** | ||
<code ini> | <code ini> | ||
[Display] | [Display] | ||
Line 54: | Line 56: | ||
Code = " | Code = " | ||
</ | </ | ||
- | Block 2 - Shader | + | **GLSL |
<code glsl> | <code glsl> | ||
#define HEX_SIZE radius | #define HEX_SIZE radius | ||
Line 167: | Line 169: | ||
} | } | ||
</ | </ | ||
- | Block 3 contains the end of the INI file: | ||
<code ini> | <code ini> | ||
" | " | ||
</ | </ | ||
- | ====CPP File==== | + | ====CPP File (tut_hex.cpp)==== |
<code cpp> | <code cpp> | ||
/** | /** |