Modify for SNES screen size

This commit is contained in:
Hajime Hoshi 2013-06-17 23:39:44 +09:00
parent e9fa26142e
commit b203859eae
2 changed files with 9 additions and 7 deletions

View File

@ -49,8 +49,8 @@ func main() {
cargc := C.int(len(cargs)) cargc := C.int(len(cargs))
screenWidth := 256 screenWidth := 256
screenHeight := 256 screenHeight := 240
screenScale := 1 screenScale := 2
C.glutInit(&cargc, &cargs[0]) C.glutInit(&cargc, &cargs[0])
C.glutInitDisplayMode(C.GLUT_RGBA); C.glutInitDisplayMode(C.GLUT_RGBA);

View File

@ -32,11 +32,13 @@ type Texture struct {
func createTexture(width, height int, pixels []uint8) *Texture{ func createTexture(width, height int, pixels []uint8) *Texture{
textureWidth := int(Clp2(uint64(width))) textureWidth := int(Clp2(uint64(width)))
textureHeight := int(Clp2(uint64(height))) textureHeight := int(Clp2(uint64(height)))
if width != textureWidth { if pixels != nil {
panic("sorry, but width should be power of 2") if width != textureWidth {
} panic("sorry, but width should be power of 2")
if height != textureHeight { }
panic("sorry, but height should be power of 2") if height != textureHeight {
panic("sorry, but height should be power of 2")
}
} }
texture := &Texture{ texture := &Texture{
id: 0, id: 0,