fix up the rest of the GL code, add glew to project, add makefiles for opengl, fix makefiles so that it can be built with gcc, update project files to automatically output to the build directory

This commit is contained in:
jp9000
2013-10-16 23:31:18 -07:00
parent 0dfc844abc
commit dfa2dc6eab
40 changed files with 937 additions and 389 deletions

View File

@@ -15,13 +15,15 @@ struct random_tex *random_create(const char *settings, obs_source_t source)
pixel |= (rand()%256);
pixel |= (rand()%256) << 8;
pixel |= (rand()%256) << 16;
//pixel |= 0xFFFFFFFF;
pixels[y*20 + x] = pixel;
}
}
gs_entercontext(obs_graphics());
rt->texture = gs_create_texture(20, 20, GS_RGBA, 1, &pixels, 0);
rt->texture = gs_create_texture(20, 20, GS_RGBA, 1,
(const void**)&pixels, 0);
bfree(pixels);
if (!rt->texture) {
@@ -61,7 +63,8 @@ uint32_t random_get_output_flags(struct random_tex *rt)
void random_video_render(struct random_tex *rt, obs_source_t filter_target)
{
technique_t tech = effect_gettechnique(rt->whatever, "Default");
effect_settexture(rt->whatever, effect_getparambyidx(rt->whatever, 1), rt->texture);
effect_settexture(rt->whatever, effect_getparambyidx(rt->whatever, 1),
rt->texture);
technique_begin(tech);
technique_beginpass(tech, 0);

View File

@@ -58,30 +58,33 @@ static void do_log(enum log_type type, const char *msg, va_list args)
OutputDebugStringA(bla);
OutputDebugStringA("\n");
if (type >= LOG_WARNING)
__debugbreak();
/*if (type >= LOG_WARNING)
__debugbreak();*/
}
static void CreateOBS(HWND hwnd)
{
RECT rc;
GetClientRect(hwnd, &rc);
struct video_info vi;
memset(&vi, 0, sizeof(struct video_info));
vi.format = "RGBA";
vi.fps_num = 30000;
vi.fps_den = 1001;
vi.width = cx;
vi.height = cy;
vi.width = rc.right;
vi.height = rc.bottom;
vi.name = "video";
struct gs_init_data gsid;
memset(&gsid, 0, sizeof(gsid));
gsid.hwnd = hwnd;
gsid.cx = cx;
gsid.cy = cy;
gsid.cx = rc.right;
gsid.cy = rc.bottom;
gsid.num_backbuffers = 2;
gsid.format = GS_RGBA;
if (!obs_startup("libobs-d3d11.dll", &gsid, &vi, NULL))
if (!obs_startup("libobs-opengl.dll", &gsid, &vi, NULL))
throw "Couldn't create OBS";
}