GLX implementation and *nix-specific file handling implementation
I added gl-x11 which allows compatibility with X11 (Xlib-based) and GLX. I also added various functions to handle file finding based on FHS. Various changes to autotools to both install files correctly and to configure correctly.
This commit is contained in:
@@ -414,9 +414,8 @@ struct gs_window {
|
||||
void *hwnd;
|
||||
#elif defined(__APPLE__)
|
||||
__unsafe_unretained id view;
|
||||
#elif defined(__posix__)
|
||||
int bla;
|
||||
/* TODO */
|
||||
#elif defined(__linux__)
|
||||
uint32_t id;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@@ -16,17 +16,52 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include "util/dstr.h"
|
||||
#include "obs.h"
|
||||
|
||||
static inline bool check_path(const char* data, const char *path, struct dstr * output)
|
||||
{
|
||||
dstr_copy(output, path);
|
||||
dstr_cat(output, data);
|
||||
|
||||
blog(LOG_INFO, "Attempting path: %s\n", output->array);
|
||||
|
||||
return access(output->array, R_OK) == 0;
|
||||
}
|
||||
|
||||
static inline bool check_lib_path(const char* data, const char *path, struct dstr *output)
|
||||
{
|
||||
bool result = false;
|
||||
struct dstr tmp;
|
||||
|
||||
dstr_init_copy(&tmp, "lib");
|
||||
dstr_cat(&tmp, data);
|
||||
dstr_cat(&tmp, ".so");
|
||||
result = check_path(tmp.array, path, output);
|
||||
|
||||
dstr_free(&tmp);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* /usr/local/lib/obs-plugins
|
||||
* /usr/lib/obs-plugins
|
||||
*/
|
||||
char *find_plugin(const char *plugin)
|
||||
{
|
||||
/* TODO */
|
||||
{
|
||||
struct dstr output;
|
||||
dstr_init(&output);
|
||||
|
||||
if (check_lib_path(plugin, "/usr/local/lib/obs-plugins/", &output))
|
||||
return output.array;
|
||||
|
||||
if (check_lib_path(plugin, "/usr/lib/obs-plugins/", &output))
|
||||
return output.array;
|
||||
|
||||
dstr_free(&output);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -36,7 +71,16 @@ char *find_plugin(const char *plugin)
|
||||
*/
|
||||
char *find_libobs_data_file(const char *file)
|
||||
{
|
||||
/* TODO */
|
||||
struct dstr output;
|
||||
dstr_init(&output);
|
||||
|
||||
if (check_path(file, "/usr/local/share/libobs/", &output))
|
||||
return output.array;
|
||||
|
||||
if (check_path(file, "/usr/share/libobs/", &output))
|
||||
return output.array;
|
||||
|
||||
dstr_free(&output);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -45,7 +89,16 @@ char *find_libobs_data_file(const char *file)
|
||||
* /usr/share/obs-plugins
|
||||
*/
|
||||
char *obs_find_plugin_file(const char *file)
|
||||
{
|
||||
/* TODO */
|
||||
return NULL;
|
||||
{
|
||||
struct dstr output;
|
||||
dstr_init(&output);
|
||||
|
||||
if (check_path(file, "/usr/local/share/obs-plugins/", &output))
|
||||
return output.array;
|
||||
|
||||
if (check_path(file, "/usr/share/obs-plugins", &output))
|
||||
return output.array;
|
||||
|
||||
dstr_free(&output);
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user