mirror of
https://github.com/JetSetIlly/Gopher2600.git
synced 2025-04-02 11:02:17 -04:00
the inside of the bevel nearest the screen reflects the colour from the screen. it's not perfect but it's a nice effect and can form the basis for something better screen centering inside solid state bevel moved very slightly to the right
80 lines
1.8 KiB
Go
80 lines
1.8 KiB
Go
// This file is part of Gopher2600.
|
|
//
|
|
// Gopher2600 is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Gopher2600 is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Gopher2600. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
package sdlimgui
|
|
|
|
import (
|
|
"image"
|
|
|
|
"github.com/inkyblackness/imgui-go/v4"
|
|
)
|
|
|
|
type requirement int
|
|
|
|
const (
|
|
requiresOpenGL32 requirement = iota
|
|
requiresOpenGL21
|
|
)
|
|
|
|
type renderer interface {
|
|
requires() requirement
|
|
supportsCRT() bool
|
|
start() error
|
|
destroy()
|
|
preRender()
|
|
render()
|
|
screenshot(mode screenshotMode, finish chan screenshotResult)
|
|
addTexture(typ shaderType, linear bool, clamp bool, config any) texture
|
|
addFontTexture(fnt imgui.FontAtlas) texture
|
|
}
|
|
|
|
type shaderType int
|
|
|
|
const (
|
|
shaderNone shaderType = iota
|
|
shaderGUI
|
|
shaderColor
|
|
shaderPlayscr
|
|
shaderBevel
|
|
shaderDbgScr
|
|
shaderDbgScrOverlay
|
|
)
|
|
|
|
type texture interface {
|
|
getID() uint32
|
|
markForCreation()
|
|
clear()
|
|
render(*image.RGBA)
|
|
}
|
|
|
|
type screenshotMode string
|
|
|
|
const (
|
|
modeSingle screenshotMode = "single"
|
|
modeDouble screenshotMode = "double"
|
|
modeTriple screenshotMode = "triple"
|
|
modeMovement screenshotMode = "movement"
|
|
)
|
|
|
|
type screenshotResult struct {
|
|
// a description of the screenshot as provided by the renderer
|
|
description string
|
|
|
|
// the final image
|
|
image *image.RGBA
|
|
|
|
// any errors that were encountered in the screenshotting preperation
|
|
err error
|
|
}
|