72 lines
1.3 KiB
C++
72 lines
1.3 KiB
C++
#include"StartScene.h"
|
|
#include"../MainScene/MainScene.h"
|
|
#include"../../audio/AudioSource.h"
|
|
#include<iostream>
|
|
|
|
bool trigger = true;
|
|
void StartScene::OnEnter()
|
|
{
|
|
std::cout << "enter¡ª¡ªstartScene" << std::endl;
|
|
trigger = true;
|
|
|
|
|
|
|
|
audio_source = m_context->m_audioManager.Load("res/sound/cat.wav");
|
|
audio_source->Play();
|
|
|
|
}
|
|
|
|
void StartScene::OnExit()
|
|
{
|
|
std::cout << "exit¡ª¡ªstartScene" << std::endl;
|
|
}
|
|
float a = 0;
|
|
float b = 0;
|
|
|
|
void StartScene::Update(float p_deltaTime)
|
|
{
|
|
if (INPUT.IsKeyDown(dKey::KEY_O)&&trigger)
|
|
{
|
|
trigger = false;
|
|
MainScene* main = new MainScene();
|
|
m_context->m_sceneManager.ChangeScene(main);
|
|
}
|
|
|
|
if (INPUT.IsKeyDown(dKey::KEY_W))
|
|
{
|
|
a += 0.05f;
|
|
}
|
|
if (INPUT.IsKeyDown(dKey::KEY_S))
|
|
{
|
|
a -= 0.05f;
|
|
}
|
|
|
|
if (INPUT.IsKeyDown(dKey::KEY_A))
|
|
{
|
|
b -= 0.05f;
|
|
}
|
|
if (INPUT.IsKeyDown(dKey::KEY_D))
|
|
{
|
|
b += 0.05f;
|
|
}
|
|
|
|
audio_source->SetDirection(a, b);
|
|
|
|
std::cout << a << " " << b << std::endl;
|
|
return;
|
|
/*resample-test*/
|
|
for (int i = 0; i < 100; i++)
|
|
{
|
|
m_context->m_gpu.drawPoint((int)((float)i / 100 * 800), orisamples[i]+300+1, RGBA(255, 255, 255, 255));
|
|
}
|
|
|
|
for (int i = 0; i < resampler.GetOutputLength(); i++)
|
|
{
|
|
m_context->m_gpu.drawPoint((int)((float)i / resampler.GetOutputLength() * 800), resamples[i] + 300, RGBA(255, 0, 0, 255));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|