-
Notifications
You must be signed in to change notification settings - Fork 0
/
linenumber.c
35 lines (27 loc) · 1.07 KB
/
linenumber.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
*
* https://ramiroblan.co
* mail: [email protected]
*
*/
#include <stdio.h> //this needs to go
#define GLFW_INCLUDE_ES3
#include <GLFW/glfw3.h>
#include "edit.h"
#include "linenumber.h"
#include "global.h"
inline void linenumber_update(unsigned int lines_count)
{
unsigned int i;
//unsigned int lines_decimals_count = 1;
//lines_decimals_count = 1;
glUseProgram(program_linenumber);
glUniform1f(grid_Y_offset_location_linenumber, grid_y_offset);
glUniform4fv(grid_location_linenumber, 1, (GLfloat*) &grid);
printf("top line: %d lines_count: %d decimals: %d\n", top_line_number, lines_count, lines_decimals_count);
printf("_lines_count: %d decimals: %d %p\n", lines_count, lines_decimals_count, grid_lines[0]);
glActiveTexture(GL_TEXTURE3);
glBindTexture(GL_TEXTURE_2D, linenumber_tex);
//glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, lines_decimals_count+1, grid.height, 0, GL_RED, GL_FLOAT, linenumbers_tex); // User glTexSubImage2D!
glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, lines_decimals_count, grid.height, 0, GL_RED, GL_FLOAT, linenumbers_tex); // User glTexSubImage2D!
}