/** Package for the Scol settings This is a part of the 'Scol voyager' ================================= License : This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to http://www.gnu.org/copyleft/lesser.txt Author : Bastien Bourineau */ // OPENGL Setup interface structure struct GLSETUPstr = [ GLSETUP_WIN : ObjWin, GLSETUP_INFO : ObjText, GLSETUP_LABEL : ObjText, GLSETUP_LABEL2 : ObjText, GLSETUP_LABELCARDINFO1 : ObjText, GLSETUP_LABELCARDINFO2 : ObjText, GLSETUP_LABELCARDINFO3 : ObjText, GLSETUP_LABELHARD : ObjText, GLSETUP_LABELSHADER1 : ObjText, GLSETUP_LABELSHADER2 : ObjText, GLSETUP_LABELSHADER3 : ObjText, GLSETUP_ALIASLABEL : ObjText, GLSETUP_ALIASCOMBO : ObjBox, GLSETUP_MIPLABEL : ObjText, GLSETUP_MIPCOMBO : ObjBox, GLSETUP_VIEW3D : T3dView // 3D preview ] mkGLSETUPstr;; typeof SETUP_GL3D = GLSETUPstr;; var sM3dPreviewPath = "";; var lSetup3dScene = "locked/voyager/3d/scene.m3d"::nil;; var sSkeletalAvatar = "locked/voyager/3d/avatar1.m3d";; var sNoAnimAvatar = "locked/voyager/3d/noavatar.m3d";; var s3dAnimFile = "locked/voyager/3d/idle1.m3d";; /* ********************************************************************************************* / Setup 3D Interface / ********************************************************************************************* */ fun Setup3dGetInfos()= let M3videoInfos -> [marque modele version _] in let _GETengineState -> state in let if (state==ENGINE_HARDWARE) then "OpenGL" else nil -> state in [marque modele version state];; fun cbSetup3dRender(viewstr)= let M3getObj viewstr.VIEW_session "logo" -> cube in M3rotateObjExt viewstr.VIEW_session cube [100 0 0]; 0;; fun cbSetupGLMultisampling(cmb, p, pos, name)= chgusm "3DMultisampling" nil let strbuild ("3DMultisampling"::name::nil)::nil -> s in substr s 0 (strlen s)-1; //reset3dView SETUP_GL3D.GLSETUP_VIEW3D; _DLGMessageBox _channel SETUP_GL3D.GLSETUP_WIN loc "ALERT" loc "CONF3DRESTARTANTIALIAS" 0; 0;; fun cbSetupGLMipmap(cmb, p, pos, name)= chgusm "3DMipmap" nil let strbuild ("3DMipmap"::name::nil)::nil -> s in substr s 0 (strlen s)-1; //chgress "3DMipmap" name; reset3dView SETUP_GL3D.GLSETUP_VIEW3D; 0;; fun cbInit3dView(viewstr)= crAv3dAnim viewstr s3dAnimFile "Bip01" "avatar" 0 2 0 400; moveViewCamera viewstr [0 80 (-700)]; 0;; fun cbSetupCr3D(strSetup)= let Setup3dGetInfos -> [marque modele version state] in ( set SETUP_GL3D = mkGLSETUPstr [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]; set SETUP_GL3D.GLSETUP_WIN = _CRwindow _channel strSetup.SETUP_WIN 210 10 iSetupChildW iSetupChildH WN_CHILDINSIDE|WN_NOCAPTION ""; set SETUP_GL3D.GLSETUP_INFO = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 10 (iSetupChildW - 20) 50 ET_ALIGN_LEFT loc "CONF3DMESS"; set SETUP_GL3D.GLSETUP_LABEL = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 70 (iSetupChildW - 20) 20 ET_ALIGN_LEFT|ET_BORDER loc "CONF3DLABEL1"; set SETUP_GL3D.GLSETUP_LABELCARDINFO1 = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 95 (iSetupChildW - 20) 15 ET_ALIGN_LEFT strcatn (loc "CONF3DCG1")::" "::marque::nil; set SETUP_GL3D.GLSETUP_LABELCARDINFO2 = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 110 (iSetupChildW - 20) 15 ET_ALIGN_LEFT strcatn (loc "CONF3DCG2")::" "::modele::nil; set SETUP_GL3D.GLSETUP_LABELCARDINFO3 = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 125 (iSetupChildW - 20) 15 ET_ALIGN_LEFT strcatn (loc "CONF3DCG3")::" "::version::nil; set SETUP_GL3D.GLSETUP_LABELHARD = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 140 (iSetupChildW - 20) 15 ET_ALIGN_LEFT strcatn (loc "CONF3DCG4")::" "::(if state == nil then (loc "CONF3DGLNOTSUPPORTED") else (loc "CONF3DSUPPORTED"))::nil; let M3isShaderVertexProfileEnable -> shader in set SETUP_GL3D.GLSETUP_LABELSHADER1 = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 155 (iSetupChildW - 20) 15 ET_ALIGN_LEFT strcatn (loc "CONF3DCG5")::" "::(if !shader then (loc "CONF3DNOTSUPPORTED") else (loc "CONF3DSUPPORTED"))::nil; let M3isShaderFragmentProfileEnable -> shader in set SETUP_GL3D.GLSETUP_LABELSHADER2 = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 170 (iSetupChildW - 20) 15 ET_ALIGN_LEFT strcatn (loc "CONF3DCG6")::" "::(if !shader then (loc "CONF3DNOTSUPPORTED") else (loc "CONF3DSUPPORTED"))::nil; let M3isShaderEnable -> shader in set SETUP_GL3D.GLSETUP_LABELSHADER3 = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 185 (iSetupChildW - 20) 15 ET_ALIGN_LEFT strcatn (loc "CONF3DCG7")::" "::(if !shader then (loc "CONF3DBADAVATAR") else (loc "CONF3DSUPPORTED"))::nil; set SETUP_GL3D.GLSETUP_LABEL2 = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 210 (iSetupChildW - 20) 20 ET_ALIGN_LEFT|ET_BORDER loc "CONF3DLABEL2"; let M3multiSamplingSupported -> [isenable value] in ( set SETUP_GL3D.GLSETUP_ALIASLABEL = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 (iSetupChildH - 55) 120 20 ET_ALIGN_LEFT loc "CONF3DANTIALIAS"; set SETUP_GL3D.GLSETUP_ALIASCOMBO = _CBcombo _CRcombo _channel SETUP_GL3D.GLSETUP_WIN 135 (iSetupChildH - 55) 100 120 CB_NOEDIT "" @cbSetupGLMultisampling nil; set SETUP_GL3D.GLSETUP_MIPLABEL = _CRtext _channel SETUP_GL3D.GLSETUP_WIN 10 (iSetupChildH - 30) 120 20 ET_ALIGN_LEFT loc "CONF3DMIPMAP"; set SETUP_GL3D.GLSETUP_MIPCOMBO = _CBcombo _CRcombo _channel SETUP_GL3D.GLSETUP_WIN 135 (iSetupChildH - 30) 100 120 CB_NOEDIT "" @cbSetupGLMipmap nil; let 0 -> i in while i <= M3maxSampleBuffers do ( _ADDcombo SETUP_GL3D.GLSETUP_ALIASCOMBO 100 itoa i; set i = i + 1; ); let 0 -> i in while i <= 3 do ( _ADDcombo SETUP_GL3D.GLSETUP_MIPCOMBO 100 itoa i; set i = i + 1; ); _SELcombo SETUP_GL3D.GLSETUP_ALIASCOMBO (let (atoi getInfo (strextr _loadusmini nil) "3DMultisampling")->n in if n==nil then 0 else n); _SELcombo SETUP_GL3D.GLSETUP_MIPCOMBO (let (atoi getInfo (strextr _loadusmini nil) "3DMipmap")->n in if n==nil then 2 else n); let (atoi getInfo (strextr _loadusmini nil) "3DMipmap") -> n in if n != nil then nil else chgusm "3DMipmap" nil let strbuild ("3DMipmap"::"2"::nil)::nil -> s in substr s 0 (strlen s)-1; ); // 3D view let (iSetupChildW - 20) -> iw in let (iSetupChildH - 295) -> ih in let if M3isShaderEnable then sSkeletalAvatar else sNoAnimAvatar -> savatar in set SETUP_GL3D.GLSETUP_VIEW3D = crView3d SETUP_GL3D.GLSETUP_WIN 10 235 iw ih savatar::lSetup3dScene 0 @cbInit3dView @cbSetup3dRender 1 1 iTheoFramerate; ); 0;; fun dsSetup3D()= ds3dView SETUP_GL3D.GLSETUP_VIEW3D; set SETUP_GL3D.GLSETUP_VIEW3D = nil; _DSwindow SETUP_GL3D.GLSETUP_WIN; set SETUP_GL3D = nil; 0;; fun loadSetup3D(strSetup)= addSetupMenu loc "CONF3D" (mkfun1 @cbSetupCr3D strSetup) @dsSetup3D; 0;;