首页 > 代码库 > GLEW_ERROR_NO_GL_VERSION的解决方法
GLEW_ERROR_NO_GL_VERSION的解决方法
关于
- GLenum err = glewInit();
- if (GLEW_OK != err)
- fprintf(stderr, "error initializaing GLew %s\n", glewGetErrorString(err));
返回:
GLEW_ERROR_NO_GL_VERSION的解决方案
就是要先初始化窗口。就是要把
- glutCreateWindow("ssss");
放在
- GLenum err = glewInit();
下面演示的是一个代码的演示
- #include<Gl/glew.h>
- #include<Gl/gl.h>
- #include<GL/GLU.h>
- #include<Gl/glut.h>
- #include<stdio.h>
- int main(int argc,char**argv)
- {
- glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGB);
- glutInit(&argc,argv);
- glutCreateWindow("ssss");
- //glm::vec4 position = glm::vec4(1, 0, 0, 1.0f);
- GLenum err = glewInit();
- if (GLEW_OK != err)
- fprintf(stderr, "error initializaing GLew %s\n", glewGetErrorString(err));
- const GLubyte*renderer = glGetString(GL_RENDER);
- const GLubyte *vendor = glGetString(GL_VENDOR);
- const GLubyte *version = glGetString(GL_VERSION);
- const GLubyte *glslVersion = glGetString(GL_SHADING_LANGUAGE_VERSION);
- GLint major, minor;
- glGetIntegerv(GL_MAJOR_VERSION, &major);
- glGetIntegerv(GL_MINOR_VERSION, &minor);
- printf("GL vendor:%s\n", vendor);
- printf("GL renderer:%s\n", renderer);
- printf("GL version(s):%s\n", version);
- printf("GL version(d):%d,%d\n", major,minor);
- printf("GL version:%s\n", glslVersion);
- return 0;
- }
得到的结果:
http://bbs.hers.com.cn/home.php?mod=space&uid=1961703&do=album&picid=3031096
http://bbs.hers.com.cn/home.php?mod=space&uid=1961703&do=album&picid=3031095
http://bbs.hers.com.cn/home.php?mod=space&uid=1961703&do=album&picid=3031094
http://bbs.hers.com.cn/home.php?mod=space&uid=1961703&do=album&picid=3031093
http://bbs.hers.com.cn/home.php?mod=space&uid=1961703&do=album&picid=3031092
http://home.9939.com/buluo/view/tid/85673
http://home.9939.com/buluo/view/tid/85674
http://home.9939.com/buluo/view/tid/85676
http://home.9939.com/buluo/view/tid/85677
http://home.9939.com/buluo/view/tid/85678
http://home.9939.com/buluo/view/tid/85679
http://home.9939.com/buluo/view/tid/85680
http://home.9939.com/buluo/view/tid/85681
http://home.9939.com/buluo/view/tid/85682
http://home.9939.com/buluo/view/tid/85683
http://home.9939.com/buluo/view/tid/85684
http://home.9939.com/buluo/view/tid/85685
http://home.9939.com/buluo/view/tid/85686
http://home.9939.com/buluo/view/tid/85687
http://home.9939.com/buluo/view/tid/85688
http://home.9939.com/buluo/view/tid/85689
http://home.9939.com/buluo/view/tid/85690
http://home.9939.com/buluo/view/tid/85691
http://home.9939.com/buluo/view/tid/85692
http://home.9939.com/buluo/view/tid/85693
http://home.9939.com/buluo/view/tid/85694
http://home.9939.com/buluo/view/tid/85695
http://home.9939.com/buluo/view/tid/85696
http://home.9939.com/buluo/view/tid/85697
http://home.9939.com/buluo/view/tid/85698
http://home.9939.com/buluo/view/tid/85699
http://home.9939.com/buluo/view/tid/85700
http://home.9939.com/buluo/view/tid/85701
http://home.9939.com/buluo/view/tid/85702
http://home.9939.com/buluo/view/tid/85703
http://home.9939.com/buluo/view/tid/85704
http://home.9939.com/buluo/view/tid/85705
http://home.9939.com/buluo/view/tid/85706
http://home.9939.com/buluo/view/tid/85707
http://home.9939.com/buluo/view/tid/85708
http://home.9939.com/buluo/view/tid/85709
http://home.9939.com/buluo/view/tid/85710
http://home.9939.com/buluo/view/tid/85711
http://home.9939.com/buluo/view/tid/85712
http://home.9939.com/buluo/view/tid/85713
http://home.9939.com/buluo/view/tid/85714
http://home.9939.com/buluo/view/tid/85715
http://home.9939.com/buluo/view/tid/85716
http://home.9939.com/buluo/view/tid/85717
http://home.9939.com/buluo/view/tid/85718
http://home.9939.com/buluo/view/tid/85719
http://home.9939.com/buluo/view/tid/85720
http://home.9939.com/buluo/view/tid/85721
http://home.9939.com/buluo/view/tid/85722
http://home.9939.com/buluo/view/tid/85723
http://home.9939.com/buluo/view/tid/85724
http://home.9939.com/buluo/view/tid/85725
http://home.9939.com/buluo/view/tid/85726
http://home.9939.com/buluo/view/tid/85727
http://home.9939.com/buluo/view/tid/85728
http://home.9939.com/buluo/view/tid/85729
http://home.9939.com/buluo/view/tid/85730
http://home.9939.com/buluo/view/tid/85731
http://home.9939.com/buluo/view/tid/85732
http://home.9939.com/buluo/view/tid/85734
http://home.9939.com/buluo/view/tid/85735
http://home.9939.com/buluo/view/tid/85736
http://home.9939.com/buluo/view/tid/85737
http://home.9939.com/buluo/view/tid/85738
http://home.9939.com/buluo/view/tid/85739
http://home.9939.com/buluo/view/tid/85740
http://home.9939.com/buluo/view/tid/85741
http://home.9939.com/buluo/view/tid/85742
http://home.9939.com/buluo/view/tid/85743
http://home.9939.com/buluo/view/tid/85744
http://home.9939.com/buluo/view/tid/85745
http://home.9939.com/buluo/view/tid/85746
http://home.9939.com/buluo/view/tid/85747
http://home.9939.com/buluo/view/tid/85748
http://home.9939.com/buluo/view/tid/85749
http://home.9939.com/buluo/view/tid/85750
http://home.9939.com/buluo/view/tid/85751
http://home.9939.com/buluo/view/tid/85752
http://home.9939.com/buluo/view/tid/85753
http://home.9939.com/buluo/view/tid/85754
http://home.9939.com/buluo/view/tid/85755
http://home.9939.com/buluo/view/tid/85756
http://home.9939.com/buluo/view/tid/85757
http://home.9939.com/buluo/view/tid/85758
http://home.9939.com/buluo/view/tid/85759
http://home.9939.com/buluo/view/tid/85760
http://home.9939.com/buluo/view/tid/85761
http://home.9939.com/buluo/view/tid/85762
http://home.9939.com/buluo/view/tid/85763
http://home.9939.com/buluo/view/tid/85764
http://home.9939.com/buluo/view/tid/85765
http://home.9939.com/buluo/view/tid/85766
http://home.9939.com/buluo/view/tid/85767
http://home.9939.com/buluo/view/tid/85768
http://home.9939.com/buluo/view/tid/85769
http://home.9939.com/buluo/view/tid/85770
http://home.9939.com/buluo/view/tid/85771
http://home.9939.com/buluo/view/tid/85772
http://home.9939.com/buluo/view/tid/85773
http://home.9939.com/buluo/view/tid/85774
http://home.9939.com/buluo/view/tid/85775
http://home.9939.com/buluo/view/tid/85776
http://home.9939.com/buluo/view/tid/85777
http://home.9939.com/buluo/view/tid/85778
http://home.9939.com/buluo/view/tid/85779
http://home.9939.com/buluo/view/tid/85780
http://home.9939.com/buluo/view/tid/85781
http://home.9939.com/buluo/view/tid/85782
http://home.9939.com/buluo/view/tid/85783
http://home.9939.com/buluo/view/tid/85784
http://home.9939.com/buluo/view/tid/85785
http://home.9939.com/buluo/view/tid/85786
http://home.9939.com/buluo/view/tid/85787
http://home.9939.com/buluo/view/tid/85788
http://home.9939.com/buluo/view/tid/85789
http://home.9939.com/buluo/view/tid/85790
http://home.9939.com/buluo/view/tid/85791
http://home.9939.com/buluo/view/tid/85792
http://home.9939.com/buluo/view/tid/85793
http://home.9939.com/buluo/view/tid/85794
http://home.9939.com/buluo/view/tid/85795
http://home.9939.com/buluo/view/tid/85796
http://home.9939.com/buluo/view/tid/85797
http://home.9939.com/buluo/view/tid/85798
http://home.9939.com/buluo/view/tid/85799
http://home.9939.com/buluo/view/tid/85800
http://home.9939.com/buluo/view/tid/85801
http://home.9939.com/buluo/view/tid/85802
http://home.9939.com/buluo/view/tid/85803
http://home.9939.com/buluo/view/tid/85804
http://home.9939.com/buluo/view/tid/85805
http://home.9939.com/buluo/view/tid/85806
http://home.9939.com/buluo/view/tid/85807
http://home.9939.com/buluo/view/tid/85808
http://home.9939.com/buluo/view/tid/85809
http://home.9939.com/buluo/view/tid/85810
http://home.9939.com/buluo/view/tid/85811
http://home.9939.com/buluo/view/tid/85812
http://home.9939.com/buluo/view/tid/85813
http://home.9939.com/buluo/view/tid/85814
http://home.9939.com/buluo/view/tid/85815
http://home.9939.com/buluo/view/tid/85816
http://home.9939.com/buluo/view/tid/85817
http://home.9939.com/buluo/view/tid/85818
http://home.9939.com/buluo/view/tid/85819
http://home.9939.com/buluo/view/tid/85820
http://home.9939.com/buluo/view/tid/85821
http://home.9939.com/buluo/view/tid/85822
http://home.9939.com/buluo/view/tid/85823
http://home.9939.com/buluo/view/tid/85824
http://home.9939.com/buluo/view/tid/85825
http://home.9939.com/buluo/view/tid/85826
http://home.9939.com/buluo/view/tid/85827
http://home.9939.com/buluo/view/tid/85828
http://home.9939.com/buluo/view/tid/85829
http://home.9939.com/buluo/view/tid/85830
http://home.9939.com/buluo/view/tid/85831
http://home.9939.com/buluo/view/tid/85832
http://home.9939.com/buluo/view/tid/85833
http://home.9939.com/buluo/view/tid/85834
http://home.9939.com/buluo/view/tid/85835
http://home.9939.com/buluo/view/tid/85836
http://home.9939.com/buluo/view/tid/85837
http://home.9939.com/buluo/view/tid/85838
http://home.9939.com/buluo/view/tid/85839
http://home.9939.com/buluo/view/tid/85840
http://home.9939.com/buluo/view/tid/85841
http://home.9939.com/buluo/view/tid/85842
http://home.9939.com/buluo/view/tid/85843
http://home.9939.com/buluo/view/tid/85844
http://home.9939.com/buluo/view/tid/85845
http://home.9939.com/buluo/view/tid/85846
http://home.9939.com/buluo/view/tid/85847
http://home.9939.com/buluo/view/tid/85848
http://home.9939.com/buluo/view/tid/85849
http://home.9939.com/buluo/view/tid/85850
http://home.9939.com/buluo/view/tid/85851
http://home.9939.com/buluo/view/tid/85852
http://home.9939.com/buluo/view/tid/85853
http://home.9939.com/buluo/view/tid/85854
http://home.9939.com/buluo/view/tid/85855
http://home.9939.com/buluo/view/tid/85856
http://home.9939.com/buluo/view/tid/85857
http://home.9939.com/buluo/view/tid/85858
http://home.9939.com/buluo/view/tid/85859
http://home.9939.com/buluo/view/tid/85860
http://home.9939.com/buluo/view/tid/85861
http://home.9939.com/buluo/view/tid/85862
http://home.9939.com/buluo/view/tid/85863
http://home.9939.com/buluo/view/tid/85864
http://home.9939.com/buluo/view/tid/85865
http://home.9939.com/buluo/view/tid/85866
http://home.9939.com/buluo/view/tid/85867
http://home.9939.com/buluo/view/tid/85868
http://home.9939.com/buluo/view/tid/85869
http://home.9939.com/buluo/view/tid/85870
http://home.9939.com/buluo/view/tid/85871
http://home.9939.com/buluo/view/tid/85872
http://home.9939.com/buluo/view/tid/85873
http://home.9939.com/buluo/view/tid/85874
http://home.9939.com/buluo/view/tid/85875
http://home.9939.com/buluo/view/tid/85876
http://home.9939.com/buluo/view/tid/85877
http://home.9939.com/buluo/view/tid/85878
http://home.9939.com/buluo/view/tid/85879
http://home.9939.com/buluo/view/tid/85880
http://home.9939.com/buluo/view/tid/85881
http://home.9939.com/buluo/view/tid/85882
http://home.9939.com/buluo/view/tid/85883
http://home.9939.com/buluo/view/tid/85884
http://home.9939.com/buluo/view/tid/85885
http://home.9939.com/buluo/view/tid/85886
http://home.9939.com/buluo/view/tid/85887
http://home.9939.com/buluo/view/tid/85888
http://home.9939.com/buluo/view/tid/85889
http://home.9939.com/buluo/view/tid/85890
http://home.9939.com/buluo/view/tid/85891
http://home.9939.com/buluo/view/tid/85892
http://home.9939.com/buluo/view/tid/85893
http://home.9939.com/buluo/view/tid/85894
http://home.9939.com/buluo/view/tid/85895
http://home.9939.com/buluo/view/tid/85896
http://home.9939.com/buluo/view/tid/85897
http://home.9939.com/buluo/view/tid/85898
http://home.9939.com/buluo/view/tid/85899
http://home.9939.com/buluo/view/tid/85900
http://home.9939.com/buluo/view/tid/85901
http://home.9939.com/buluo/view/tid/85902
http://home.9939.com/buluo/view/tid/85903
http://home.9939.com/buluo/view/tid/85904
http://home.9939.com/buluo/view/tid/85905
http://home.9939.com/buluo/view/tid/85906
http://home.9939.com/buluo/view/tid/85907
http://home.9939.com/buluo/view/tid/85908
http://home.9939.com/buluo/view/tid/85909
http://home.9939.com/buluo/view/tid/85910
http://home.9939.com/buluo/view/tid/85911
http://home.9939.com/buluo/view/tid/85912
http://home.9939.com/buluo/view/tid/85913
http://home.9939.com/buluo/view/tid/85914
http://home.9939.com/buluo/view/tid/85915
http://home.9939.com/buluo/view/tid/85916
http://home.9939.com/buluo/view/tid/85917
http://home.9939.com/buluo/view/tid/85918
http://home.9939.com/buluo/view/tid/85919
http://home.9939.com/buluo/view/tid/85920
http://home.9939.com/buluo/view/tid/85921
http://home.9939.com/buluo/view/tid/85922
http://home.9939.com/buluo/view/tid/85923
http://home.9939.com/buluo/view/tid/85924
http://home.9939.com/buluo/view/tid/85925
http://home.9939.com/buluo/view/tid/85926
http://home.9939.com/buluo/view/tid/85927
http://home.9939.com/buluo/view/tid/85928
http://home.9939.com/buluo/view/tid/85929
http://home.9939.com/buluo/view/tid/85930
http://home.9939.com/buluo/view/tid/85931
http://home.9939.com/buluo/view/tid/85932
http://home.9939.com/buluo/view/tid/85933
http://home.9939.com/buluo/view/tid/85934
http://home.9939.com/buluo/view/tid/85935
http://home.9939.com/buluo/view/tid/85936
http://home.9939.com/buluo/view/tid/85937
http://home.9939.com/buluo/view/tid/85938
http://home.9939.com/buluo/view/tid/85939
http://home.9939.com/buluo/view/tid/85940
http://home.9939.com/buluo/view/tid/85941
http://home.9939.com/buluo/view/tid/85942
http://home.9939.com/buluo/view/tid/85943
http://home.9939.com/buluo/view/tid/85944
http://home.9939.com/buluo/view/tid/85945
http://home.9939.com/buluo/view/tid/85946
http://home.9939.com/buluo/view/tid/85947
http://home.9939.com/buluo/view/tid/85948
http://home.9939.com/buluo/view/tid/85949
http://home.9939.com/buluo/view/tid/85950
http://home.9939.com/buluo/view/tid/85951
http://home.9939.com/buluo/view/tid/85952
http://home.9939.com/buluo/view/tid/85953
http://home.9939.com/buluo/view/tid/85954
http://home.9939.com/buluo/view/tid/85955
http://home.9939.com/buluo/view/tid/85956
http://home.9939.com/buluo/view/tid/85957
http://home.9939.com/buluo/view/tid/85958
http://home.9939.com/buluo/view/tid/85959
http://home.9939.com/buluo/view/tid/85960
http://home.9939.com/buluo/view/tid/85961
http://home.9939.com/buluo/view/tid/85962
http://home.9939.com/buluo/view/tid/85963
http://home.9939.com/buluo/view/tid/85964
http://home.9939.com/buluo/view/tid/85965
http://home.9939.com/buluo/view/tid/85966
http://home.9939.com/buluo/view/tid/85967
http://home.9939.com/buluo/view/tid/85968
http://home.9939.com/buluo/view/tid/85969
http://www.dxy.cn/bbs/topic/29303043
http://www.dxy.cn/bbs/topic/29303052
http://www.dxy.cn/bbs/topic/29303060
GLEW_ERROR_NO_GL_VERSION的解决方法