sglimg2.f90

来自「Fortran 95程序设计&Code-彭国伦」· F90 代码 · 共 30 行

F90
30
字号
module sgl_util
  use sgl
  implicit none
  integer(1), save :: buffer(3*512*512)
  integer(4), save :: buffer4(3*512*512/4)
  equivalence(buffer,buffer4)
contains
  subroutine display()
    call sglPutRGBBuffer(buffer,0,0,512,512)
  end subroutine
end module

program main
  use sgl_util
  implicit none
  integer i
  
  open(10, file="512x512.raw",&
       form="unformatted",access="direct",&
	   recl=1,status="old")
  do i=1,512*512*3/4
    read(10,rec=i) buffer4(i)
  end do
  close(10)
  call sglDisplaySub(display)
  call sglEnableReshape(0)
  call sglCreateWindow(50,50,512,512,0)
  call sglMainLoop()
  stop
end program

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?