Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2018-06-22 03:35:37 +0300
committerRay Molenkamp <github@lazydodo.com>2018-06-22 03:36:05 +0300
commit84ae0fe3a5f5707a5ff658292fefcfc5f9cf04b8 (patch)
tree1a1ac643881b2b8c0fc891589cf3f7ef057f6015 /source/blender/gpu/GPU_texture.h
parent4f83fd4cf8b69497beddc498033a7a2beea24d80 (diff)
GLRefactor: Refactor bf_blenfont to use GPUTexture instead of raw GL calls and types.
In an effort to centralize all opengl calls in the codebase, this patch replaces the raw opengl calls in bf_blenfont with GPUTexture so it's no longer depended on opengl headers. reviewer: Brecht Differential Revision: https://developer.blender.org/D3483
Diffstat (limited to 'source/blender/gpu/GPU_texture.h')
-rw-r--r--source/blender/gpu/GPU_texture.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index e53693e7b40..3ab270f9064 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -142,6 +142,19 @@ typedef enum GPUTextureFormat {
GPU_DEPTH_COMPONENT16,
} GPUTextureFormat;
+/* These map directly to the GL_ blend functions, to minimize API add as needed*/
+typedef enum GPUBlendFunction {
+ GPU_ONE,
+ GPU_SRC_ALPHA,
+ GPU_ONE_MINUS_SRC_ALPHA
+} GPUBlendFunction;
+
+/* These map directly to the GL_ filter functions, to minimize API add as needed*/
+typedef enum GPUFilterFunction {
+ GPU_NEAREST,
+ GPU_LINEAR
+} GPUFilterFunction;
+
unsigned int GPU_texture_memory_usage_get(void);
GPUTexture *GPU_texture_create_1D(
@@ -166,7 +179,8 @@ GPUTexture *GPU_texture_from_blender(
struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time);
GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap);
-void GPU_texture_update(GPUTexture *tex, const float *pixels);
+void GPU_texture_update(GPUTexture *tex, const void *pixels);
+void GPU_texture_update_sub(GPUTexture *tex, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth);
void GPU_invalid_tex_init(void);
void GPU_invalid_tex_bind(int mode);
@@ -189,6 +203,7 @@ void GPU_texture_compare_mode(GPUTexture *tex, bool use_compare);
void GPU_texture_filter_mode(GPUTexture *tex, bool use_filter);
void GPU_texture_mipmap_mode(GPUTexture *tex, bool use_mipmap, bool use_filter);
void GPU_texture_wrap_mode(GPUTexture *tex, bool use_repeat);
+void GPU_texture_filters(GPUTexture *tex, GPUFilterFunction min_filter, GPUFilterFunction mag_filter);
void GPU_texture_attach_framebuffer(GPUTexture *tex, struct GPUFrameBuffer *fb, int attachment);
int GPU_texture_detach_framebuffer(GPUTexture *tex, struct GPUFrameBuffer *fb);
@@ -204,6 +219,10 @@ bool GPU_texture_stencil(const GPUTexture *tex);
bool GPU_texture_integer(const GPUTexture *tex);
int GPU_texture_opengl_bindcode(const GPUTexture *tex);
+void GPU_blend(bool enable);
+void GPU_blend_set_func_separate(GPUBlendFunction src_rgb, GPUBlendFunction dst_rgb, GPUBlendFunction src_alpha, GPUBlendFunction dst_alpha);
+void GPU_blend_set_func(GPUBlendFunction sfactor, GPUBlendFunction dfactor);
+
#ifdef __cplusplus
}
#endif