xref: /expo/packages/expo-gl/ios/EXGLObject.mm (revision d9e7b303)
1// Copyright 2016-present 650 Industries. All rights reserved.
2
3#import <ExpoGL/EXGLObject.h>
4
5@implementation EXGLObject
6
7- (instancetype)initWithConfig:(NSDictionary *)config
8{
9  if ((self = [super init])) {
10    _exglCtxId = [config[@"exglCtxId"] unsignedIntValue];
11    _exglObjId = EXGLContextCreateObject(_exglCtxId);
12  }
13  return self;
14}
15
16- (void)dealloc
17{
18  if (_exglObjId != 0) {
19    EXGLContextDestroyObject(_exglCtxId, _exglObjId);
20  }
21}
22
23@end
24
25