mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Modify for SNES screen size
This commit is contained in:
parent
e9fa26142e
commit
b203859eae
@ -49,8 +49,8 @@ func main() {
|
||||
cargc := C.int(len(cargs))
|
||||
|
||||
screenWidth := 256
|
||||
screenHeight := 256
|
||||
screenScale := 1
|
||||
screenHeight := 240
|
||||
screenScale := 2
|
||||
|
||||
C.glutInit(&cargc, &cargs[0])
|
||||
C.glutInitDisplayMode(C.GLUT_RGBA);
|
||||
|
@ -32,11 +32,13 @@ type Texture struct {
|
||||
func createTexture(width, height int, pixels []uint8) *Texture{
|
||||
textureWidth := int(Clp2(uint64(width)))
|
||||
textureHeight := int(Clp2(uint64(height)))
|
||||
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 pixels != nil {
|
||||
if width != textureWidth {
|
||||
panic("sorry, but width should be power of 2")
|
||||
}
|
||||
if height != textureHeight {
|
||||
panic("sorry, but height should be power of 2")
|
||||
}
|
||||
}
|
||||
texture := &Texture{
|
||||
id: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user