mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
- Rename @extern to @cname, deprecating the old name #2493.
This commit is contained in:
@@ -23,14 +23,14 @@ enum Primitive : int (int value)
|
||||
POLYGON = 9,
|
||||
}
|
||||
|
||||
extern fn void clear(BitField mask) @extern("glClear") @public;
|
||||
extern fn void clear(BitField mask) @cname("glClear") @public;
|
||||
|
||||
extern fn void begin(BitField mask) @extern("glBegin") @public;
|
||||
extern fn void begin(BitField mask) @cname("glBegin") @public;
|
||||
|
||||
extern fn void end() @extern("glEnd") @public;
|
||||
extern fn void end() @cname("glEnd") @public;
|
||||
|
||||
extern fn void flush() @extern("glFlush") @public;
|
||||
extern fn void flush() @cname("glFlush") @public;
|
||||
|
||||
extern fn void color3f(float r, float g, float b) @extern("glColor3f") @public;
|
||||
extern fn void color3f(float r, float g, float b) @cname("glColor3f") @public;
|
||||
|
||||
extern fn void vertex3f(float x, float y, float z) @extern("glVertex3f") @public;
|
||||
extern fn void vertex3f(float x, float y, float z) @cname("glVertex3f") @public;
|
||||
@@ -31,21 +31,21 @@ fn void Window.makeContextCurrent(self) @public
|
||||
return _glfwMakeContextCurrent((_Window*)self);
|
||||
}
|
||||
|
||||
extern fn void initialize() @extern("glfwInit") @public;
|
||||
extern fn void initialize() @cname("glfwInit") @public;
|
||||
|
||||
extern fn void terminate() @extern("glfwTerminate") @public;
|
||||
extern fn void terminate() @cname("glfwTerminate") @public;
|
||||
|
||||
extern fn void pollEvents() @extern("glfwPollEvents") @public;
|
||||
extern fn void pollEvents() @cname("glfwPollEvents") @public;
|
||||
|
||||
typedef _Window @private = void;
|
||||
typedef _Monitor @private = void;
|
||||
|
||||
extern fn _Window* _glfwCreateWindow(int width, int height, char* title, _Monitor* monitor, _Window* share) @extern("glfwCreateWindow") @private;
|
||||
extern fn _Window* _glfwCreateWindow(int width, int height, char* title, _Monitor* monitor, _Window* share) @cname("glfwCreateWindow") @private;
|
||||
|
||||
extern fn bool _glfwWindowShouldClose(_Window* window) @extern("glfwWindowShouldClose") @private;
|
||||
extern fn bool _glfwWindowShouldClose(_Window* window) @cname("glfwWindowShouldClose") @private;
|
||||
|
||||
extern fn void _glfwDestroyWindow(_Window* window) @extern("glfwDestroyWindow") @private;
|
||||
extern fn void _glfwDestroyWindow(_Window* window) @cname("glfwDestroyWindow") @private;
|
||||
|
||||
extern fn void _glfwSwapBuffers(_Window* window) @extern("glfwSwapBuffers") @private;
|
||||
extern fn void _glfwSwapBuffers(_Window* window) @cname("glfwSwapBuffers") @private;
|
||||
|
||||
extern fn void _glfwMakeContextCurrent(_Window* window) @extern("glfwMakeContextCurrent") @private;
|
||||
extern fn void _glfwMakeContextCurrent(_Window* window) @cname("glfwMakeContextCurrent") @private;
|
||||
@@ -48,11 +48,11 @@ const SYSTEM_HIDE_GAMEPAD_OVERLAY = 2;
|
||||
// └───────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
/* Copies pixels to the framebuffer. */
|
||||
extern fn void blit(char* data, int x, int y, uint width, uint height, uint flags) @extern("blit");
|
||||
extern fn void blit(char* data, int x, int y, uint width, uint height, uint flags) @cname("blit");
|
||||
|
||||
/* Copies a subregion within a larger sprite atlas to the framebuffer. */
|
||||
extern fn void blit_sub(char* data, int x, int y, uint width, uint height,
|
||||
uint src_x, uint src_y, uint stride, uint flags) @extern("blitSub");
|
||||
uint src_x, uint src_y, uint stride, uint flags) @cname("blitSub");
|
||||
|
||||
const BLIT_2BPP = 1;
|
||||
const BLIT_1BPP = 0;
|
||||
@@ -76,7 +76,7 @@ extern fn void oval(int x, int y, uint width, uint height);
|
||||
extern fn void rect(int x, int y, uint width, uint height);
|
||||
|
||||
/* Draws text using the built-in system font. */
|
||||
extern fn void text(char* text, int x, int y) @extern("text");
|
||||
extern fn void text(char* text, int x, int y) @cname("text");
|
||||
|
||||
// ┌───────────────────────────────────────────────────────────────────────────┐
|
||||
// │ │
|
||||
@@ -127,10 +127,10 @@ char[8] smiley = {
|
||||
0b11000011,
|
||||
};
|
||||
|
||||
fn void start() @extern("start")
|
||||
fn void start() @cname("start")
|
||||
{}
|
||||
|
||||
fn void update() @extern("update")
|
||||
fn void update() @cname("update")
|
||||
{
|
||||
DRAW_COLORS[0] = 2;
|
||||
text("Hello from C3", 10, 10);
|
||||
|
||||
Reference in New Issue
Block a user