<commit_before>import os

import numpy as np
from pyrr import Matrix44

import moderngl
from ported._example import Example
from basic_colors_and_texture import ColorsAndTexture


class RenderToTexture(ColorsAndTexture):
    title = "Render to Texture"
    gl_version = (3, 3)

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        self.texture = self.ctx.texture(self.wnd.size, 3)
        depth_attachment = self.ctx.depth_renderbuffer(self.wnd.size)
        self.fbo = self.ctx.framebuffer(self.texture, depth_attachment)

    def render(self, time, frame_time):
        self.ctx.clear(1.0, 1.0, 1.0)
        self.ctx.enable(moderngl.DEPTH_TEST)

        proj = Matrix44.perspective_projection(45.0, self.aspect_ratio, 0.1, 1000.0)
        lookat = Matrix44.look_at(
            (47.697, -8.147, 24.498),
            (0.0, 0.0, 8.0),
            (0.0, 0.0, 1.0),
        )

        rotate = Matrix44.from_z_rotation(np.sin(time) * 0.5 + 0.2)

        for mode in ['render_to_texture', 'render_to_window']:
            if mode == 'render_to_texture':
                self.fbo.clear(1.0, 1.0, 1.0)
                self.fbo.use()
            else:
                self.ctx.screen.use()

            super().render(time, frame_time)


if __name__ == '__main__':
    RenderToTexture.run()
<commit_msg>render_to_texcture: Remove more dead code<commit_after>import moderngl
from basic_colors_and_texture import ColorsAndTexture


class RenderToTexture(ColorsAndTexture):
    title = "Render to Texture"
    gl_version = (3, 3)

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        self.texture = self.ctx.texture(self.wnd.size, 3)
        depth_attachment = self.ctx.depth_renderbuffer(self.wnd.size)
        self.fbo = self.ctx.framebuffer(self.texture, depth_attachment)

    def render(self, time, frame_time):
        self.ctx.clear(1.0, 1.0, 1.0)
        self.ctx.enable(moderngl.DEPTH_TEST)

        for mode in ['render_to_texture', 'render_to_window']:
            if mode == 'render_to_texture':
                self.fbo.clear(1.0, 1.0, 1.0)
                self.fbo.use()
            else:
                self.ctx.screen.use()

            super().render(time, frame_time)


if __name__ == '__main__':
    RenderToTexture.run()

{'fraction_non_alphanumeric': 0.12395970214629873, 'fraction_numerical': 0.03416557161629435, 'mean_word_length': 2.4191616766467066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5200508', 'n_tokens_mistral': 829, 'n_tokens_neox': 769, 'n_words': 148}