// Copyright 2016-present 650 Industries. All rights reserved.

#import <EXGL/EXGLObject.h>

@implementation EXGLObject

- (instancetype)initWithConfig:(NSDictionary *)config
{
  if ((self = [super init])) {
    _exglCtxId = [config[@"exglCtxId"] unsignedIntValue];
    _exglObjId = UEXGLContextCreateObject(_exglCtxId);
  }
  return self;
}

- (void)dealloc
{
  if (_exglObjId != 0) {
    UEXGLContextDestroyObject(_exglCtxId, _exglObjId);
  }
}

@end

