FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/examples/tutorial/tutorial02module.cpp at master · jacereda/daScript · GitHub
jacereda
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
examples
/
tutorial
/
tutorial02module.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (25 loc) · 1018 Bytes
Breadcrumbs
daScript
/
examples
/
tutorial
/
tutorial02module.cpp
Copy path
File metadata and controls
29 lines (25 loc) · 1018 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
include
"
daScript/daScript.h
"
#
include
"
tutorial02aot.h
"
using
namespace
das
;
//
making custom builtin module
class
Module_Tutorial02
:
public
Module
{
public:
Module_Tutorial02
() : Module(
"
tutorial_02
"
) {
//
module name, when used from das file
ModuleLibrary
lib
(
this
);
lib.
addBuiltInModule
();
//
adding constant to the module
addConstant
(*
this
,
"
SQRT2
"
,
sqrtf
(
2.0
));
//
adding function to the module
addExtern<
DAS_BIND_FUN
(xmadd)>(*
this
, lib,
"
xmadd
"
,SideEffects::none,
"
xmadd
"
);
//
and verify
verifyAotReady
();
}
virtual
ModuleAotType
aotRequire
( TextWriter & tw )
const
override
{
//
specifying which include files are required for this module
tw <<
"
#include
\"
tutorial02aot.h
\"\n
"
;
//
specifying AOT type, in this case direct cpp mode (and not hybrid mode)
return
ModuleAotType::cpp;
}
};
//
registering module, so that its available via 'NEED_MODULE' macro
REGISTER_MODULE
(Module_Tutorial02);
Back
|
FazBrowse Home
|
New Git URL