Skip to content

Commit d3827dd

Browse files
committed
init
1 parent d3786fb commit d3827dd

10 files changed

+3161
-0
lines changed

.gitignore

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
db.sqlite3-journal
62+
63+
# Flask stuff:
64+
instance/
65+
.webassets-cache
66+
67+
# Scrapy stuff:
68+
.scrapy
69+
70+
# Sphinx documentation
71+
docs/_build/
72+
73+
# PyBuilder
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
83+
# pyenv
84+
.python-version
85+
86+
# pipenv
87+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
88+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
89+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
90+
# install all needed dependencies.
91+
#Pipfile.lock
92+
93+
# celery beat schedule file
94+
celerybeat-schedule
95+
96+
# SageMath parsed files
97+
*.sage.py
98+
99+
# Environments
100+
.env
101+
.venv
102+
env/
103+
venv/
104+
ENV/
105+
env.bak/
106+
venv.bak/
107+
108+
# Spyder project settings
109+
.spyderproject
110+
.spyproject
111+
112+
# Rope project settings
113+
.ropeproject
114+
115+
# mkdocs documentation
116+
/site
117+
118+
# mypy
119+
.mypy_cache/
120+
.dmypy.json
121+
dmypy.json
122+
123+
# Pyre type checker
124+
.pyre/
125+
126+
.idea/
127+
__pycache__/

OpenGL_PlayGround.py

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import sys
2+
from OpenGL.GL import *
3+
from OpenGL.GLU import *
4+
from OpenGL.GLUT import *
5+
6+
7+
8+
9+
def init():
10+
glClearColor(1, 1, 1, 1)
11+
# glClearColor(0, 0, 0, 1)
12+
gluOrtho2D(0, 1000, 0, 1000)
13+
14+
15+
def triangle():
16+
glClear(GL_COLOR_BUFFER_BIT)
17+
glColor3f(1, 0, 0)
18+
glBegin(GL_TRIANGLES)
19+
20+
glColor3f(1, 0, 0)
21+
glVertex2f(-1, -1)
22+
23+
glColor3f(0, 1, 0)
24+
glVertex2f(1, -1)
25+
26+
glColor3f(0, 0, 1)
27+
glVertex2f(0, 1)
28+
29+
glEnd()
30+
glFlush()
31+
32+
33+
class Points:
34+
points = []
35+
36+
def draw_points(self):
37+
glColor3f(1, 0, 0)
38+
glPointSize(5)
39+
glBegin(GL_POINTS)
40+
for point in self.points:
41+
if point[2] == 0:
42+
glColor3f(1, 1, 1)
43+
elif point[2] == 1:
44+
glColor3f(0, 1, 0)
45+
elif point[2] == 2:
46+
glColor3f(0, 0, 1)
47+
elif point[2] == 3:
48+
glColor3f(0, 1, 1)
49+
glVertex2i(point[0] * 5, point[1] * 5)
50+
glEnd()
51+
glFlush()
52+
53+
54+
# def point():
55+
# glClear(GL_COLOR_BUFFER_BIT)
56+
# glColor3f(1.0, 0, 0)
57+
# glPointSize(1)
58+
#
59+
# glBegin(GL_POINTS)
60+
# glVertex2i(100, 300)
61+
# glEnd()
62+
# glFlush()
63+
64+
65+
points = Points()
66+
67+
68+
69+
def main():
70+
glutInit(sys.argv)
71+
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)
72+
glutInitWindowSize(1000, 1000)
73+
glutInitWindowPosition(50, 50)
74+
glutCreateWindow("FuckCPP")
75+
glutDisplayFunc(points.draw_points)
76+
init()
77+
glutMainLoop()
78+
79+
80+
def draw_pixel(x, y, color):
81+
points.points.append([x, y, color])
82+
83+
84+
if __name__ == '__main__':
85+
main()

chr

Whitespace-only changes.

0 commit comments

Comments
 (0)