format
This commit is contained in:
parent
58de3bbbeb
commit
edd75c58f6
6 changed files with 36 additions and 14 deletions
20
.clang-format
Normal file
20
.clang-format
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
Language: Cpp
|
||||||
|
UseTab: Always
|
||||||
|
TabWidth: 8
|
||||||
|
AlignConsecutiveAssignments:
|
||||||
|
Enabled: true
|
||||||
|
AlignConsecutiveDeclarations:
|
||||||
|
Enabled: true
|
||||||
|
IndentWidth: 8
|
||||||
|
PointerAlignment: Left
|
||||||
|
ColumnLimit: 0
|
||||||
|
AllowShortIfStatementsOnASingleLine: Always
|
||||||
|
AllowShortBlocksOnASingleLine: Never
|
||||||
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
|
AllowShortLoopsOnASingleLine: true
|
||||||
|
SpaceBeforeParens: Never
|
||||||
|
AlignEscapedNewlines: DontAlign
|
||||||
|
SortIncludes: false
|
||||||
|
AllowShortEnumsOnASingleLine: false
|
||||||
|
#IndentPPDirectives: AfterHash
|
||||||
|
|
@ -2,38 +2,38 @@
|
||||||
|
|
||||||
MwWidget root, window, opengl;
|
MwWidget root, window, opengl;
|
||||||
|
|
||||||
static void resize(MwWidget handle, void* user, void* client){
|
static void resize(MwWidget handle, void* user, void* client) {
|
||||||
int ww = MwGetInteger(window, MwNwidth);
|
int ww = MwGetInteger(window, MwNwidth);
|
||||||
int wh = MwGetInteger(window, MwNheight);
|
int wh = MwGetInteger(window, MwNheight);
|
||||||
|
|
||||||
MwVaApply(opengl,
|
MwVaApply(opengl,
|
||||||
MwNwidth, ww,
|
MwNwidth, ww,
|
||||||
MwNheight, wh,
|
MwNheight, wh,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
glViewport(0, 0, ww, wh);
|
glViewport(0, 0, ww, wh);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tick(MwWidget handle, void* user, void* client){
|
static void tick(MwWidget handle, void* user, void* client) {
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
MwOpenGLSwapBuffer(opengl);
|
MwOpenGLSwapBuffer(opengl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* gl_load(const char* name){
|
static void* gl_load(const char* name) {
|
||||||
return MwOpenGLGetProcAddress(opengl, name);
|
return MwOpenGLGetProcAddress(opengl, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
MwLibraryInit();
|
MwLibraryInit();
|
||||||
|
|
||||||
root = MwVaCreateWidget(NULL, "root", NULL, 0, 0, 0, 0,
|
root = MwVaCreateWidget(NULL, "root", NULL, 0, 0, 0, 0,
|
||||||
MwNwaitMS, 15,
|
MwNwaitMS, 15,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
window = MwVaCreateWidget(MwWindowClass, "main", root, MwDEFAULT, MwDEFAULT, 800, 600,
|
window = MwVaCreateWidget(MwWindowClass, "main", root, MwDEFAULT, MwDEFAULT, 800, 600,
|
||||||
MwNtitle, "AssaultFish",
|
MwNtitle, "AssaultFish",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 0, 0, 800, 600);
|
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 0, 0, 800, 600);
|
||||||
|
|
||||||
|
|
|
||||||
2
external/milsko
vendored
2
external/milsko
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 012650f06f489d1219ba492118d2f35d25e93ce2
|
Subproject commit 75749697ba25330127fdca110fda9098d65719e3
|
||||||
2
format.sh
Executable file
2
format.sh
Executable file
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
clang-format --verbose -i `find include server client -name "*.c" -or -name "*.h"`
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
/* should be broadcasted! otherwise other user wouldn't know */
|
/* should be broadcasted! otherwise other user wouldn't know */
|
||||||
typedef struct af_pkt_join {
|
typedef struct af_pkt_join {
|
||||||
unsigned char length;
|
unsigned char length;
|
||||||
char* name;
|
char* name;
|
||||||
} af_pkt_join_t;
|
} af_pkt_join_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include <af_common.h>
|
#include <af_common.h>
|
||||||
|
|
||||||
int main(int argc, char** argv){
|
int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue