質問編集履歴
5
タイトルを編集しました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
GLSLを使った描画ができない理由が知りたい。
|
1
|
+
GLSLを使った描画ができない理由が知りたい。Github全ソースあり
|
test
CHANGED
File without changes
|
4
文章にGithubを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
参考サイト: https://tokoik.github.io/GLFWdraft.pdf (163ページに数式を移しました(ビュー行列))
|
26
26
|
|
27
|
-
|
27
|
+
Github: https://github.com/Shigurechan/project
|
28
28
|
|
29
29
|
|
30
30
|
|
3
提示コードを編集しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -408,6 +408,12 @@
|
|
408
408
|
|
409
409
|
|
410
410
|
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
411
417
|
```cpp
|
412
418
|
|
413
419
|
#include "Game.hpp"
|
@@ -428,13 +434,13 @@
|
|
428
434
|
|
429
435
|
|
430
436
|
|
431
|
-
|
437
|
+
|
432
438
|
|
433
439
|
//透視投影変換行列を作る
|
434
440
|
|
435
441
|
void Game::create_maxtri_mp(float top, float bottom, float left, float right,
|
436
442
|
|
437
|
-
float
|
443
|
+
float near, float far, float result[4][4])
|
438
444
|
|
439
445
|
{
|
440
446
|
|
@@ -478,7 +484,7 @@
|
|
478
484
|
|
479
485
|
}
|
480
486
|
|
481
|
-
|
487
|
+
|
482
488
|
|
483
489
|
|
484
490
|
|
@@ -610,344 +616,362 @@
|
|
610
616
|
|
611
617
|
GLuint out_frag = glCreateShader(GL_FRAGMENT_SHADER);
|
612
618
|
|
619
|
+
|
620
|
+
|
621
|
+
//頂点シェーダーを読み込み
|
622
|
+
|
623
|
+
std::string fileName = "Basic.vert";
|
624
|
+
|
625
|
+
std::ifstream shaderfile(fileName);
|
626
|
+
|
627
|
+
if (shaderfile.is_open())
|
628
|
+
|
629
|
+
{
|
630
|
+
|
631
|
+
std::stringstream sstream;
|
632
|
+
|
633
|
+
sstream << shaderfile.rdbuf();
|
634
|
+
|
635
|
+
std::string str = sstream.str();
|
636
|
+
|
637
|
+
const char* cc = str.c_str();
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
out_vert = glCreateShader(GL_VERTEX_SHADER);
|
642
|
+
|
643
|
+
glShaderSource(out_vert, 1, &cc, nullptr);
|
644
|
+
|
645
|
+
glCompileShader(out_vert);
|
646
|
+
|
647
|
+
//printf("Basic.vert ファイル読み込み\n");
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
GetShader_Log(out_vert, GL_COMPILE_STATUS);
|
652
|
+
|
653
|
+
glAttachShader(program, out_vert);
|
654
|
+
|
655
|
+
shaderfile.close();
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
}
|
660
|
+
|
661
|
+
else {
|
662
|
+
|
663
|
+
shaderfile.close();
|
664
|
+
|
665
|
+
printf("ファイル: %s が読み込めませんでした。", fileName.c_str());
|
666
|
+
|
667
|
+
}
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
//バーティックスシェーダーを読み込み
|
674
|
+
|
675
|
+
fileName = "Basic.frag";
|
676
|
+
|
677
|
+
shaderfile.open(fileName);
|
678
|
+
|
679
|
+
if (shaderfile.is_open())
|
680
|
+
|
681
|
+
{
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
std::stringstream sstream;
|
686
|
+
|
687
|
+
sstream << shaderfile.rdbuf();
|
688
|
+
|
689
|
+
std::string str = sstream.str();
|
690
|
+
|
691
|
+
const char* cc = str.c_str();
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
out_frag = glCreateShader(GL_FRAGMENT_SHADER);
|
696
|
+
|
697
|
+
glShaderSource(out_frag, 1, &cc, nullptr);
|
698
|
+
|
699
|
+
glCompileShader(out_frag);
|
700
|
+
|
701
|
+
GetShader_Log(out_frag, GL_COMPILE_STATUS);
|
702
|
+
|
703
|
+
glAttachShader(program, out_frag);
|
704
|
+
|
705
|
+
shaderfile.close();
|
706
|
+
|
707
|
+
|
708
|
+
|
709
|
+
// printf("Basic.frag ファイル読み込み\n");
|
710
|
+
|
711
|
+
}
|
712
|
+
|
713
|
+
else {
|
714
|
+
|
715
|
+
shaderfile.close();
|
716
|
+
|
717
|
+
printf("ファイル: %s が読み込めませんでした。", fileName.c_str());
|
718
|
+
|
719
|
+
}
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
|
726
|
+
|
727
|
+
glLinkProgram(program);
|
728
|
+
|
729
|
+
//使わなくなったシェーダーオブジェクトを削除
|
730
|
+
|
731
|
+
glDeleteShader(out_frag);
|
732
|
+
|
733
|
+
glDeleteShader(out_vert);
|
734
|
+
|
735
|
+
glUseProgram(program);
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
//シェーダーに値を渡す
|
742
|
+
|
743
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
744
|
+
|
745
|
+
//*****************************************************************************
|
746
|
+
|
747
|
+
float mp[4][4];
|
748
|
+
|
749
|
+
create_maxtri_mp(HEIGHT, -HEIGHT, -WIDTH, WIDTH, 0.1, 0.0000000001, mp);//透視行列を作成
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
//フラグメントシェーダー
|
754
|
+
|
755
|
+
glBindAttribLocation(program, 0, "Vertex");
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
|
761
|
+
//頂点シェーダー
|
762
|
+
|
763
|
+
glBindAttribLocation(program, 0, "Vertex");
|
764
|
+
|
765
|
+
glUniformMatrix4fv(glGetUniformLocation(program, "scale"), 0, GL_TRUE, &scale[0][0]);
|
766
|
+
|
767
|
+
glUniformMatrix4fv(glGetUniformLocation(program, "rotate"), 1, GL_TRUE, &rotate[0][0]);
|
768
|
+
|
769
|
+
glUniformMatrix4fv(glGetUniformLocation(program, "move"), 2, GL_TRUE, &move[0][0]);
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
|
774
|
+
|
775
|
+
glUniformMatrix4fv(glGetUniformLocation(program, "MP"), 3, GL_TRUE, &mp[0][0]);
|
776
|
+
|
777
|
+
//*****************************************************************************
|
778
|
+
|
779
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
780
|
+
|
781
|
+
glUseProgram(program);
|
782
|
+
|
783
|
+
|
784
|
+
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
|
789
|
+
return true;
|
790
|
+
|
791
|
+
}
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
//初期化
|
802
|
+
|
803
|
+
bool Game::Initialization()
|
804
|
+
|
805
|
+
{
|
806
|
+
|
807
|
+
//画面初期化 関係
|
808
|
+
|
809
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
810
|
+
|
811
|
+
//glfwの初期化に失敗
|
812
|
+
|
813
|
+
if (glfwInit() != GL_TRUE)
|
814
|
+
|
815
|
+
{
|
816
|
+
|
817
|
+
printf("glfwInit()失敗\n");
|
818
|
+
|
819
|
+
int _c = getchar();
|
820
|
+
|
821
|
+
|
822
|
+
|
823
|
+
return 0;
|
824
|
+
|
825
|
+
}
|
826
|
+
|
827
|
+
|
828
|
+
|
829
|
+
//コンテキストを作成
|
830
|
+
|
831
|
+
Window = glfwCreateWindow(640, 400, "Hello", NULL, NULL);
|
832
|
+
|
833
|
+
|
834
|
+
|
835
|
+
//OpenGLコンテキストの作成に失敗
|
836
|
+
|
837
|
+
if (Window == NULL)
|
838
|
+
|
839
|
+
{
|
840
|
+
|
841
|
+
printf("glfCreateWindow()失敗\n");
|
842
|
+
|
843
|
+
int c = getchar();
|
844
|
+
|
845
|
+
|
846
|
+
|
847
|
+
return 0;
|
848
|
+
|
849
|
+
}
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
//コンテキストをOpenGLの描画対象にする。
|
854
|
+
|
855
|
+
glfwMakeContextCurrent(Window);
|
856
|
+
|
857
|
+
|
858
|
+
|
859
|
+
//glewを初期化する。
|
860
|
+
|
861
|
+
glewExperimental = GL_TRUE;
|
862
|
+
|
863
|
+
if (glewInit() != GLEW_OK)
|
864
|
+
|
865
|
+
{
|
866
|
+
|
867
|
+
printf("glewInit() の初期化に失敗しました。");
|
868
|
+
|
869
|
+
return 0;
|
870
|
+
|
871
|
+
}
|
872
|
+
|
873
|
+
|
874
|
+
|
875
|
+
//OpenGLバージョン指定
|
876
|
+
|
877
|
+
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
878
|
+
|
879
|
+
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 0);
|
880
|
+
|
881
|
+
|
882
|
+
|
883
|
+
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
884
|
+
|
885
|
+
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
886
|
+
|
887
|
+
|
888
|
+
|
889
|
+
//垂直同期のタイミングを待つ
|
890
|
+
|
891
|
+
glfwSwapInterval(1);
|
892
|
+
|
893
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
894
|
+
|
895
|
+
|
896
|
+
|
897
|
+
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
if (Shader() == true)//シェーダーを読み込む
|
902
|
+
|
903
|
+
{
|
904
|
+
|
905
|
+
printf("シェーダーを読み込む\n");
|
906
|
+
|
907
|
+
}
|
908
|
+
|
909
|
+
|
910
|
+
|
911
|
+
|
912
|
+
|
913
|
+
glGenVertexArrays(1, &vbo);
|
914
|
+
|
915
|
+
glBindVertexArray(vbo);
|
916
|
+
|
917
|
+
glGenBuffers(1, &vbo);
|
918
|
+
|
919
|
+
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
920
|
+
|
921
|
+
glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex), Vertex, GL_STATIC_DRAW);///////
|
922
|
+
|
923
|
+
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
924
|
+
|
925
|
+
glEnableVertexAttribArray(0);
|
926
|
+
|
927
|
+
//glEnableClientState(GL_VERTEX_ARRAY);//クライアントで頂点を有効にする。
|
928
|
+
|
613
929
|
|
614
930
|
|
931
|
+
|
932
|
+
|
933
|
+
|
934
|
+
|
935
|
+
|
936
|
+
|
937
|
+
|
938
|
+
|
939
|
+
mIsRunLoop = true;
|
940
|
+
|
941
|
+
return mIsRunLoop;
|
942
|
+
|
943
|
+
}
|
944
|
+
|
945
|
+
|
946
|
+
|
615
|
-
|
947
|
+
//アップデート
|
616
|
-
|
617
|
-
|
948
|
+
|
618
|
-
|
619
|
-
std::ifstream shaderfile(fileName);
|
620
|
-
|
621
|
-
|
949
|
+
void Game::Update()
|
950
|
+
|
951
|
+
{
|
952
|
+
|
953
|
+
if (glfwGetKey(Window, GLFW_KEY_ESCAPE) == GLFW_PRESS || glfwWindowShouldClose(Window) != GL_FALSE)
|
622
954
|
|
623
955
|
{
|
624
956
|
|
625
|
-
std::stringstream sstream;
|
626
|
-
|
627
|
-
sstream << shaderfile.rdbuf();
|
628
|
-
|
629
|
-
std::string str = sstream.str();
|
630
|
-
|
631
|
-
const char* cc = str.c_str();
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
out_vert = glCreateShader(GL_VERTEX_SHADER);
|
636
|
-
|
637
|
-
glShaderSource(out_vert, 1, &cc, nullptr);
|
638
|
-
|
639
|
-
glCompileShader(out_vert);
|
640
|
-
|
641
|
-
//printf("Basic.vert ファイル読み込み\n");
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
GetShader_Log(out_vert, GL_COMPILE_STATUS);
|
646
|
-
|
647
|
-
glAttachShader(program, out_vert);
|
648
|
-
|
649
|
-
s
|
957
|
+
mIsRunLoop = false;
|
650
|
-
|
651
|
-
|
652
|
-
|
958
|
+
|
653
|
-
}
|
959
|
+
}
|
654
|
-
|
655
|
-
|
960
|
+
|
656
|
-
|
657
|
-
|
961
|
+
|
658
|
-
|
659
|
-
|
962
|
+
|
660
|
-
|
661
|
-
|
963
|
+
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
//バーティックスシェーダーを読み込み
|
668
|
-
|
669
|
-
fileName = "Basic.frag";
|
670
|
-
|
671
|
-
shaderfile.open(fileName);
|
672
|
-
|
673
|
-
if (shaderfile.is_open())
|
674
|
-
|
675
|
-
{
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
std::stringstream sstream;
|
680
|
-
|
681
|
-
sstream << shaderfile.rdbuf();
|
682
|
-
|
683
|
-
std::string str = sstream.str();
|
684
|
-
|
685
|
-
const char* cc = str.c_str();
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
out_frag = glCreateShader(GL_FRAGMENT_SHADER);
|
690
|
-
|
691
|
-
glShaderSource(out_frag, 1, &cc, nullptr);
|
692
|
-
|
693
|
-
glCompileShader(out_frag);
|
694
|
-
|
695
|
-
GetShader_Log(out_frag, GL_COMPILE_STATUS);
|
696
|
-
|
697
|
-
glAttachShader(program, out_frag);
|
698
|
-
|
699
|
-
shaderfile.close();
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
// printf("Basic.frag ファイル読み込み\n");
|
704
|
-
|
705
|
-
}
|
706
|
-
|
707
|
-
else {
|
708
|
-
|
709
|
-
shaderfile.close();
|
710
|
-
|
711
|
-
printf("ファイル: %s が読み込めませんでした。",fileName.c_str());
|
712
|
-
|
713
|
-
}
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
//シェーダーに値を渡す
|
718
|
-
|
719
|
-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
720
|
-
|
721
|
-
//*****************************************************************************
|
722
|
-
|
723
|
-
float mp[4][4];
|
724
|
-
|
725
|
-
create_maxtri_mp(HEIGHT, -HEIGHT, -WIDTH, WIDTH, 0.1, 0.0000000001, mp);//透視行列を作成
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
//フラグメントシェーダー
|
730
|
-
|
731
|
-
glBindAttribLocation(program, 0, "Vertex");
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
//頂点シェーダー
|
738
|
-
|
739
|
-
glBindAttribLocation(program,0,"Vertex");
|
740
|
-
|
741
|
-
glUniformMatrix4fv(glGetUniformLocation(program,"scale"),0, GL_TRUE, &scale[0][0]);
|
742
|
-
|
743
|
-
glUniformMatrix4fv(glGetUniformLocation(program, "rotate"), 1, GL_TRUE, &rotate[0][0]);
|
744
|
-
|
745
|
-
glUniformMatrix4fv(glGetUniformLocation(program, "move"), 2, GL_TRUE, &move[0][0]);
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
glUniformMatrix4fv(glGetUniformLocation(program, "MP"), 3, GL_TRUE, &mp[0][0]);
|
752
|
-
|
753
|
-
//*****************************************************************************
|
754
|
-
|
755
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
glLinkProgram(program);
|
760
|
-
|
761
|
-
//使わなくなったシェーダーオブジェクトを削除
|
762
|
-
|
763
|
-
glDeleteShader(out_frag);
|
764
|
-
|
765
|
-
glDeleteShader(out_vert);
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
return true;
|
770
964
|
|
771
965
|
}
|
772
966
|
|
773
967
|
|
774
968
|
|
775
|
-
|
776
|
-
|
777
|
-
//
|
969
|
+
//描画アップデート
|
778
|
-
|
970
|
+
|
779
|
-
|
971
|
+
void Game::GenerateOutput()
|
780
972
|
|
781
973
|
{
|
782
974
|
|
783
|
-
//画面初期化 関係
|
784
|
-
|
785
|
-
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
786
|
-
|
787
|
-
//glfwの初期化に失敗
|
788
|
-
|
789
|
-
if (glfwInit() != GL_TRUE)
|
790
|
-
|
791
|
-
{
|
792
|
-
|
793
|
-
printf("glfwInit()失敗\n");
|
794
|
-
|
795
|
-
int _c = getchar();
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
return 0;
|
800
|
-
|
801
|
-
}
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
//コンテキストを作成
|
806
|
-
|
807
|
-
Window = glfwCreateWindow(640, 400, "Hello", NULL, NULL);
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
//OpenGLコンテキストの作成に失敗
|
812
|
-
|
813
|
-
if (Window == NULL)
|
814
|
-
|
815
|
-
{
|
816
|
-
|
817
|
-
printf("glfCreateWindow()失敗\n");
|
818
|
-
|
819
|
-
int c = getchar();
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
return 0;
|
824
|
-
|
825
|
-
}
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
//コンテキストをOpenGLの描画対象にする。
|
830
|
-
|
831
|
-
glfwMakeContextCurrent(Window);
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
//glewを初期化する。
|
836
|
-
|
837
|
-
glewExperimental = GL_TRUE;
|
838
|
-
|
839
|
-
if (glewInit() != GLEW_OK)
|
840
|
-
|
841
|
-
{
|
842
|
-
|
843
|
-
printf("glewInit() の初期化に失敗しました。");
|
844
|
-
|
845
|
-
return 0;
|
846
|
-
|
847
|
-
}
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
//OpenGLバージョン指定
|
852
|
-
|
853
|
-
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
854
|
-
|
855
|
-
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 0);
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
860
|
-
|
861
|
-
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
//垂直同期のタイミングを待つ
|
866
|
-
|
867
|
-
glfwSwapInterval(1);
|
868
|
-
|
869
|
-
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
if (Shader() == true)//シェーダーを読み込む
|
878
|
-
|
879
|
-
{
|
880
|
-
|
881
|
-
printf("シェーダーを読み込む\n");
|
882
|
-
|
883
|
-
}
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
glGenVertexArrays(1, &vbo);
|
890
|
-
|
891
|
-
glBindVertexArray(vbo);
|
892
|
-
|
893
|
-
glGenBuffers(1, &vbo);
|
894
|
-
|
895
|
-
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
896
|
-
|
897
|
-
glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex), Vertex, GL_STATIC_DRAW);///////
|
898
|
-
|
899
|
-
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
900
|
-
|
901
|
-
glEnableVertexAttribArray(0);
|
902
|
-
|
903
|
-
glEnableClientState(GL_VERTEX_ARRAY);//クライアントで頂点を有効にする。
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
mIsRunLoop = true;
|
916
|
-
|
917
|
-
return mIsRunLoop;
|
918
|
-
|
919
|
-
}
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
//アップデート
|
924
|
-
|
925
|
-
void Game::Update()
|
926
|
-
|
927
|
-
{
|
928
|
-
|
929
|
-
if (glfwGetKey(Window, GLFW_KEY_ESCAPE) == GLFW_PRESS || glfwWindowShouldClose(Window) != GL_FALSE)
|
930
|
-
|
931
|
-
{
|
932
|
-
|
933
|
-
mIsRunLoop = false;
|
934
|
-
|
935
|
-
}
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
}
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
//描画アップデート
|
946
|
-
|
947
|
-
void Game::GenerateOutput()
|
948
|
-
|
949
|
-
{
|
950
|
-
|
951
975
|
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
|
952
976
|
|
953
977
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
@@ -956,47 +980,17 @@
|
|
956
980
|
|
957
981
|
|
958
982
|
|
959
|
-
|
983
|
+
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
984
|
+
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
985
|
+
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
986
|
+
|
982
|
-
|
983
|
-
|
987
|
+
glDrawArrays(GL_POLYGON,0,18);
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
+
|
988
|
-
|
989
|
-
|
989
|
+
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
990
|
+
|
994
|
-
|
995
|
-
|
991
|
+
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
992
|
+
|
993
|
+
|
1000
994
|
|
1001
995
|
|
1002
996
|
|
2
タイトルを編集しました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
GLSLを使った描画ができない理由が知りたい。
|
test
CHANGED
File without changes
|
1
文章を編集しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
※ コメント部/////で囲ってあるコードが該当コードです。
|
24
24
|
|
25
|
-
|
25
|
+
参考サイト: https://tokoik.github.io/GLFWdraft.pdf (163ページに数式を移しました(ビュー行列))
|
26
26
|
|
27
27
|
|
28
28
|
|