Commit d29339e2 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

More HAVE_GL commits

parent a44a3287
......@@ -10,8 +10,8 @@
#include "libretro.h"
uint32_t video_width = 640;
uint32_t video_height = 480;
int screen_width = 640;
int screen_height = 480;
u16 kcode[4] = {0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF};
u8 rt[4] = {0, 0, 0, 0};
......@@ -156,6 +156,9 @@ void retro_deinit(void)
void retro_run (void)
{
co_dc_run();
#if defined(GL) || defined(GLES)
video_cb(RETRO_HW_FRAME_BUFFER_VALID, screen_width, screen_height, 0);
#endif
}
void retro_reset (void)
......@@ -168,6 +171,10 @@ static void context_reset(void)
{
rglgen_resolve_symbols(hw_render.get_proc_address);
}
static void context_destroy(void)
{
}
#endif
// Loading/unloading games
......@@ -195,9 +202,18 @@ bool retro_load_game(const struct retro_game_info *game)
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL;
#endif
#endif
hw_render.context_reset = context_reset;
hw_render.context_reset = context_destroy;
hw_render.depth = true;
hw_render.stencil = true;
hw_render.bottom_left_origin = true;
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
return false;
#endif
co_switch(ct_dc);
return true;
}
bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info)
......@@ -269,10 +285,10 @@ void retro_get_system_info(struct retro_system_info *info)
void retro_get_system_av_info(struct retro_system_av_info *info)
{
info->geometry.base_width = video_width;
info->geometry.base_height = video_height;
info->geometry.max_width = video_width;
info->geometry.max_height = video_height;
info->geometry.base_width = screen_width;
info->geometry.base_height = screen_height;
info->geometry.max_width = screen_width;
info->geometry.max_height = screen_height;
info->geometry.aspect_ratio = 4.0 / 3.0;
info->timing.fps = 60.0; //FIXME: This might differ for non-NTSC games
info->timing.sample_rate = 44100.0;
......
#pragma once
#include "rend/rend.h"
#ifndef __LIBRETRO__
#ifdef __LIBRETRO__
#include <glsym/glsym.h>
#else
#include <GL3/gl3w.h>
#endif
......
......@@ -205,8 +205,8 @@ void main() \n\
gl_ctx gl;
int screen_width;
int screen_height;
extern int screen_width;
extern int screen_height;
// Create a basic GLES context
bool gl_init(void* wind, void* disp)
......
......@@ -142,7 +142,8 @@ OPTFLAGS := -O0
else
OPTFLAGS := -O3
endif
RZDCY_CFLAGS := $(CFLAGS) -c $(OPTFLAGS) -DRELEASE -frename-registers -fsingle-precision-constant -ffast-math -ftree-vectorize -fomit-frame-pointer -D__LIBRETRO__
RZDCY_CFLAGS += $(CFLAGS) -c $(OPTFLAGS) -DRELEASE -frename-registers -fsingle-precision-constant -ffast-math -ftree-vectorize -fomit-frame-pointer -D__LIBRETRO__
CFLAGS += -D__LIBRETRO__
ifeq ($(WITH_DYNAREC), arm)
RZDCY_CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16
......@@ -235,7 +236,7 @@ $(TARGET): $(OBJECTS)
$(CXX) $(EXTRAFLAGS) $(INCFLAGS) $(CFLAGS) $(MFLAGS) $(CXXFLAGS) $< -o $@
%.o: %.c
$(CC) $(EXTRAFLAGS) $(INCFLAGS) $(CFLAGS) $< -o $@
$(CC) $(EXTRAFLAGS) $(INCFLAGS) $(CFLAGS) $(MFLAGS) $< -o $@
%.o: %.S
$(CC_AS) $(ASFLAGS) $(INCFLAGS) $< -o $@
......
INCFLAGS += -I$(CORE_DIR) \
-I$(CORE_DIR)/deps \
-I$(CORE_DIR)/khronos \
-I$(CORE_DIR)/libretro-common/include
SOURCES_C :=
SOURCES_CXX := $(CORE_DIR)/cfg/ini.cpp \
\
$(CORE_DIR)/hw/arm7/arm_mem.cpp \
......@@ -102,7 +102,8 @@ ifeq ($(HAVE_GL), 1)
SOURCES_CXX += $(CORE_DIR)/rend/gles/gldraw.cpp \
$(CORE_DIR)/rend/gles/gles_libretro.cpp \
$(CORE_DIR)/rend/gles/gltex.cpp
SOURCES_C += $(CORE_DIR)/libretro-common/glsym/rglgen.c
SOURCES_C += $(CORE_DIR)/libretro-common/glsym/rglgen.c \
$(CORE_DIR)/libretro-common/glsym/glsym_gl.c
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment