sokol: remove an absolute import

pull/8292/head
Alexander Medvednikov 2021-01-23 10:32:00 +01:00
parent d991712b3c
commit 45cc3ec664
4 changed files with 27 additions and 40 deletions

View File

@ -2864,6 +2864,7 @@ _SAPP_OBJC_RELEASE( menu_bar );
///////////////////////////////////////////////////////
// Create a child view for native rendering
CGRect wRect = _sapp.macos.window.frame;
NSView *contentView =_sapp.macos.window.contentView;
@ -2876,15 +2877,11 @@ NSWindow *overlayWindow = [[NSWindow alloc]initWithContentRect:rect
defer:NO];
//overlayWindow.backgroundColor = [NSColor whiteColor];
//overlayWindow.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0];
[overlayWindow setOpaque:YES];
[_sapp.macos.window setIgnoresMouseEvents:NO];
//[_sapp.macos.window setOpaque:NO];
//overlayWindow.alphaValue =0.1f;///.1f;
g_view = [[MyView2 alloc] init];
@ -2913,7 +2910,8 @@ g_view = [[MyView2 alloc] init];
}
@end
#include "/Users/alex/code/v/thirdparty/sokol/sokol_app2.h"
//#include "/Users/alex/code/v/thirdparty/sokol/sokol_app2.h"
#include "sokol_app2.h"
@implementation _sapp_macos_window_delegate
- (BOOL)windowShouldClose:(id)sender {

View File

@ -7,30 +7,23 @@ pub const (
#flag -I @VROOT/thirdparty/sokol
#flag -I @VROOT/thirdparty/sokol/util
#flag freebsd -I /usr/local/include
#flag darwin -fobjc-arc
#flag linux -lX11 -lGL -lXcursor -lXi
#flag freebsd -L/usr/local/lib -lX11 -lGL -lXcursor -lXi
#flag windows -lgdi32
// METAL
#flag darwin -DSOKOL_METAL
#flag darwin -framework Metal -framework Cocoa -framework MetalKit -framework QuartzCore
// OPENGL
#flag linux -DSOKOL_GLCORE33
#flag freebsd -DSOKOL_GLCORE33
//#flag darwin -framework OpenGL -framework Cocoa -framework QuartzCore
// D3D
#flag windows -DSOKOL_GLCORE33
//#flag windows -DSOKOL_D3D11
// for simplicity, all header includes are here because import order matters and we dont have any way
// to ensure import order with V yet
#define SOKOL_IMPL
// TODO should not be defined for android graphic (apk/aab using sokol) builds, but we have no ways to undefine
//#define SOKOL_NO_ENTRY
#flag linux -DSOKOL_NO_ENTRY
@ -40,14 +33,10 @@ pub const (
#flag freebsd -DSOKOL_NO_ENTRY
#flag solaris -DSOKOL_NO_ENTRY
// TODO end
#include "sokol_v.h"
#include "sokol_app.h"
#define SOKOL_IMPL
#define SOKOL_NO_DEPRECATED
#include "sokol_gfx.h"
#define SOKOL_GL_IMPL
#include "util/sokol_gl.h"

View File

@ -1964,7 +1964,7 @@ fn (mut p Parser) const_decl() ast.ConstDecl {
}
pos := p.tok.position()
name := p.check_name()
if false && util.contains_capital(name) {
if util.contains_capital(name) {
p.warn_with_pos('$p.file_name_dir const names cannot contain uppercase letters, use snake_case instead',
pos)
}