コード例 #1
0
ファイル: app.cpp プロジェクト: Aidonis/OpenGL201
ApplicationFail App::Init() {
    //Init GLFW
    if(glfwInit() == false) {
        return ApplicationFail::GLFW_INIT;
    }

    //Generate Window
    CreateGLWindow();

    //
    if(ogl_LoadFunctions() == ogl_LOAD_FAILED) {
        glfwDestroyWindow(window);
        glfwTerminate();
        return ApplicationFail::OGL_LOAD_FUNCATIONS;
    }

    //Load Gizmos
    Gizmos::create();

    //Camera
    CreateCamera();

    // Load Model File
    model = LoadFBX("./rsc/models/soulspear/soulspear.fbx");
    renderOBJ = CreateRenderObject(model);

    //FrameBuffer
    //CreateFrameBuffer();
    //CreatePlane();
    //CreatePlaneShader();

    //Quad - Post Process Init
    CreateQuad();
    CreateQuadShader();
    CreateQuadBuffer();

    //Load + Bind Texture File
    LoadTexture();

    //Set Clear Screen
    glClearColor(0.25f, 0.25f, 0.25f, 1);
    glEnable(GL_DEPTH_TEST); // enables the depth buffer

    //Texture Shader
    CreateShaderProgram();




    //Time

    return ApplicationFail::NONE;
}
コード例 #2
0
ファイル: K2World.cpp プロジェクト: wangyanxing/Demi3D
    DiK2RenderObject* DiK2World::AddRenderObj(const DiString& mdf, 
        K2ObjSubTypes::Type subtype, const Trans& trans, int id, uint32 queryFlag)
    {
        auto objtype = K2ObjSubTypes::GetObjType(subtype);

        DiK2RenderObject* renderObj = CreateRenderObject(objtype);
        renderObj->LoadModel(mdf);

        renderObj->SetWorldPosition(trans.pos);
        renderObj->SetRotation(trans.rot);
        renderObj->SetScale(trans.scale);

        renderObj->GetModel()->AddQueryFlags(queryFlag);

        if (subtype == K2ObjSubTypes::SUB_STATIC_TREE)
            ProcessTrees(renderObj);
        else if (subtype == K2ObjSubTypes::SUB_STATIC_CLIFF)
            ProcessCliff(renderObj);

        return renderObj;
    }