help with an old script

Someone can help me to migrate this code that worked on 2.49b to the 2.56?

import GameLogic as G
import BGL
scene = G.getCurrentScene()
cont = G.getCurrentController()`

objList = scene.objects
own = cont.owner

viewport = BGL.Buffer(BGL.GL_INT, 4)
BGL.glGetIntegerv(BGL.GL_VIEWPORT, viewport);

own.width = viewport[2]
own.height = viewport[3]

thanks a lot!

GameLogic has been replaced with bge.logic. for starters.

There’s also bge.render. though I’m not sure if that replaced BGL.

Thanks ace dragon, So I ll only need to replace the GameLogic with the bge.logic. and everywhere where It reads BGL i need to use bge.render? I ll try here right now! Thanks

Thanks Ace dragon but it didnt worked, I had tried to replace those and I got syntax error.

bge.render replaced the Rasterizer module. I think BGL has been replaced by ‘bgl’, case-sensitive.

thanks joeman16, I really appreciatte your help

No problem.