?? sgldemo1.f90
字號(hào):
program main
use sgl
implicit none
external display ! 聲明display是個(gè)函數(shù)
! 設(shè)定當(dāng)窗口需要重繪時(shí),會(huì)調(diào)用子程序display
call sglDisplaySub(display)
! 打開(kāi)窗口, 窗口左上角為(100,100), 長(zhǎng)寬同為500
call sglCreateWindow(100,100,500,500,0)
write(*,*) "Waiting message."
! 等待使用者給程序的信息
call sglMainLoop()
write(*,*) "The End."
stop
end
! 每當(dāng)窗口需要更新畫(huà)面時(shí), 會(huì)調(diào)用display
subroutine display()
use sgl
implicit none
call sglClearBuffer() ! 消除屏幕
call sglColor3f(1.0,0.0,0.0) ! 設(shè)定目前要使用紅色來(lái)繪圖
call sglDrawLine(0,0, 500,500) ! 在(0,0)到(500,500)兩點(diǎn)之間畫(huà)線
return
end subroutine
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -