mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08: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))
|
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);
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user