mirror of
https://github.com/cmosher01/Epple-II.git
synced 2024-12-21 22:29:30 +00:00
minor fixes
This commit is contained in:
parent
2749f8ef74
commit
58f9575823
@ -4,6 +4,7 @@ set -e
|
||||
|
||||
if [ -e "$1/CMakeCache.txt" ] ; then
|
||||
builddir="$1"
|
||||
shift
|
||||
else
|
||||
mkdir -p tmp
|
||||
builddir=$(mktemp -d tmp/tmp.XXXXXXXXXX)
|
||||
|
@ -4,15 +4,14 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk-2.0/gtk/gtkwindow.h>
|
||||
#include <gtk-2.0/gtk/gtkwidget.h>
|
||||
|
||||
void *get_gtk_native_window_handle(void *widget) {
|
||||
GtkWidget *gtk_widget = GTK_WIDGET(widget);
|
||||
|
||||
gtk_widget_realize(gtk_widget);
|
||||
|
||||
GdkWindow *gdk_window = gtk_widget_get_window(gtk_widget);
|
||||
Window xid = gdk_x11_window_get_xid(gdk_window);
|
||||
|
||||
return reinterpret_cast<void*>(xid);
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,7 @@ class ScreenException {
|
||||
ScreenImage::ScreenImage(Emulator &emulator, KeyEventHandler &k) :
|
||||
wxFrame(nullptr, wxID_ANY, "Emulator"),
|
||||
emu(emulator),
|
||||
window(nullptr),
|
||||
fullscreen(false),
|
||||
buffer(true),
|
||||
display(AnalogTV::TV_OLD_COLOR),
|
||||
@ -92,12 +93,6 @@ ScreenImage::~ScreenImage() {
|
||||
|
||||
|
||||
|
||||
void ScreenImage::OnIdle(wxIdleEvent &evt) {
|
||||
// if (!this->FindFocus() || !this->wxPanelEmuScreen->HasFocus()) {
|
||||
// this->wxPanelEmuScreen->SetFocus();
|
||||
// }
|
||||
}
|
||||
|
||||
void ScreenImage::HandleUserCloseWindowRequest(wxCloseEvent& event) {
|
||||
wxGetApp().StopEmulator();
|
||||
}
|
||||
@ -167,6 +162,9 @@ void ScreenImage::createSdlTexture() {
|
||||
}
|
||||
|
||||
void ScreenImage::destroyScreen() {
|
||||
if (!this->window) {
|
||||
return;
|
||||
}
|
||||
SDL_DestroyTexture(this->texture);
|
||||
SDL_DestroyRenderer(this->renderer);
|
||||
SDL_DestroyWindow(this->window);
|
||||
@ -336,6 +334,9 @@ void ScreenImage::drawPower(bool on) {
|
||||
}
|
||||
|
||||
void ScreenImage::notifyObservers() {
|
||||
if (!this->window) {
|
||||
return;
|
||||
}
|
||||
const int e = SDL_UpdateTexture(this->texture, NULL, this->pixels, SCRW*sizeof(unsigned int));
|
||||
if (e) {
|
||||
std::cerr << SDL_GetError() << std::endl;
|
||||
|
@ -57,7 +57,6 @@ private:
|
||||
void createSdlTexture();
|
||||
void destroyScreen();
|
||||
|
||||
void OnIdle(wxIdleEvent &evt);
|
||||
void OnKeyDown(wxKeyEvent &evt);
|
||||
void OnKeyUp(wxKeyEvent &evt);
|
||||
void HandleUserCloseWindowRequest(wxCloseEvent& event);
|
||||
|
Loading…
Reference in New Issue
Block a user