/**
 * Copyright (c) 2021 Dominic Masters
 * 
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

#include "asset.h"

scripterreturn_t _scriptApiShaderLoad(scriptercontext_t *ctx) {
  assetShaderLoad(
    duk_to_pointer(ctx, 0),
    duk_to_string(ctx, 1),
    duk_to_string(ctx, 2)
  );
  return 0;
}

scripterreturn_t _scriptApiTextureLoad(scriptercontext_t *ctx) {
  assetTextureLoad(
    duk_to_pointer(ctx, 0),
    duk_to_string(ctx, 1)
  );
  return 0;
}

void scriptsApiAsset(scripter_t *s) {
  scripterDefineMethod(s, "assetShaderLoad", 3, &_scriptApiShaderLoad);
  scripterDefineMethod(s, "assetTextureLoad", 2, &_scriptApiTextureLoad);
}