mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2025-02-26 06:46:23 +00:00
merge 026d6fe andyvn22-cocotron
This commit is contained in:
commit
90bb689d24
@ -8,6 +8,7 @@
|
||||
#import <X11/Xlib.h>
|
||||
#import <GL/gl.h>
|
||||
#import <GL/glx.h>
|
||||
#import <GL/glext.h>
|
||||
#import <pthread.h>
|
||||
|
||||
struct _CGLContextObj {
|
||||
@ -421,4 +422,30 @@ CGLError CGLDescribePixelFormat(CGLPixelFormatObj pixelFormat,GLint screenNumber
|
||||
return kCGLNoError;
|
||||
}
|
||||
|
||||
void CGLBufferData(GLenum target,GLsizeiptr size,const GLvoid *data,GLenum usage) {
|
||||
glBufferData(target,size,data,usage);
|
||||
}
|
||||
|
||||
void CGLGenBuffers(GLsizei n,GLuint *buffers) {
|
||||
glGenBuffers(n,buffers);
|
||||
}
|
||||
|
||||
void CGLDeleteBuffers(GLsizei n,const GLuint *buffers) {
|
||||
glDeleteBuffers(n,buffers);
|
||||
}
|
||||
|
||||
void CGLBindBuffer(GLenum target,GLuint buffer) {
|
||||
glBindBuffer(target,buffer);
|
||||
}
|
||||
|
||||
void *CGLMapBuffer(GLenum target,GLenum access) {
|
||||
return glMapBuffer(target,access);
|
||||
}
|
||||
|
||||
CGL_EXPORT GLboolean CGLUnmapBuffer(GLenum target) {
|
||||
return glUnmapBuffer(target);
|
||||
}
|
||||
|
||||
void CGLBufferSubData(GLenum target,GLintptr offset,GLsizeiptr size,const GLvoid *data) {
|
||||
glBufferSubData(target,offset,size,data);
|
||||
}
|
||||
|
@ -8,6 +8,19 @@
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import "O2Font_FT.h"
|
||||
|
||||
O2FontRef O2FontCreateWithFontName_platform(NSString *name) {
|
||||
return [[O2Font_FT alloc] initWithFontName:name];
|
||||
}
|
||||
|
||||
O2FontRef O2FontCreateWithDataProvider_platform(O2DataProviderRef provider) {
|
||||
#ifdef FREETYPE_PRESENT
|
||||
return [[O2Font_freetype alloc] initWithDataProvider:provider];
|
||||
#else
|
||||
return nil;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@implementation O2Font(FreeType)
|
||||
|
||||
+allocWithZone:(NSZone *)zone {
|
||||
|
@ -20,6 +20,7 @@
|
||||
#import <AppKit/O2Font_FT.h>
|
||||
#import <AppKit/NSFontManager.h>
|
||||
#import <AppKit/NSFontTypeface.h>
|
||||
#import <AppKit/NSWindow.h>
|
||||
#import <fcntl.h>
|
||||
#import <fontconfig.h>
|
||||
#import <X11/Xutil.h>
|
||||
|
@ -428,3 +428,29 @@ static int ignoreBadWindow(Display* display,
|
||||
|
||||
|
||||
@end
|
||||
|
||||
CGRect CGInsetRectForNativeWindowBorder(CGRect frame,unsigned styleMask){
|
||||
CGFloat top,left,bottom,right;
|
||||
|
||||
CGNativeBorderFrameWidthsForStyle(styleMask,&top,&left,&bottom,&right);
|
||||
|
||||
frame.origin.x+=left;
|
||||
frame.origin.y+=bottom;
|
||||
frame.size.width-=left+right;
|
||||
frame.size.height-=top+bottom;
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
CGRect CGOutsetRectForNativeWindowBorder(CGRect frame,unsigned styleMask){
|
||||
CGFloat top,left,bottom,right;
|
||||
|
||||
CGNativeBorderFrameWidthsForStyle(styleMask,&top,&left,&bottom,&right);
|
||||
|
||||
frame.origin.x-=left;
|
||||
frame.origin.y-=bottom;
|
||||
frame.size.width+=left+right;
|
||||
frame.size.height+=top+bottom;
|
||||
|
||||
return frame;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user