MCPcopy Create free account
hub / github.com/creationix/node-sdl / SetColorKey

Method SetColorKey

src/sdl.cc:649–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

647}
648
649static Handle<Value> sdl::SetColorKey(const Arguments& args) {
650 HandleScope scope;
651
652 if (!(args.Length() == 3 && args[0]->IsObject() && args[1]->IsNumber() && args[2]->IsNumber())) {
653 return ThrowException(Exception::TypeError(String::New("Invalid arguments: Expected SetColorKey(Surface, Number, Number)")));
654 }
655
656 SDL_Surface* surface = UnwrapSurface(args[0]->ToObject());
657 int flag = args[1]->Int32Value();
658 int key = args[2]->Int32Value();
659
660 if (SDL_SetColorKey(surface, flag, key) < 0) return ThrowSDLException(__func__);
661
662 return Undefined();
663
664}
665
666static Handle<Value> sdl::DisplayFormat(const Arguments& args) {
667 HandleScope scope;

Callers

nothing calls this directly

Calls 2

UnwrapSurfaceFunction · 0.85
ThrowSDLExceptionFunction · 0.85

Tested by

no test coverage detected